- Home /
growing / feeding NEED HELP!!!
i have a game and i have everything set perfectly, but the most important part. I can't think of how to code it in javascript. My game is a 3rd person shooting a carrot at a rabbit. I have everything perfect but the script to make the bunny grow. I want a collision script so once a carrot hit the bunny it makes the bunny grow. The bunny is named "bunny" and has a "capsule collider" and a "rigidbody". The carrot that is being shot and suppose to be consumed. The carrot's name is "carrot". I would like for him to grow by half his size each time. This would be GREATLY appreciated. for example what i'd like for it to say and for it work like this.
var Size = Bunny.scale(x,y,z) var Carrot = carrot.prefab var Bunny = bunny.prefab
function update () { if Carrot.Position(x,y,z) = Bunny.Position(x,y,z) then size*2 = Bunny.scale(x,y,z) }
see i would like the variable to connect to my prefabs and when the carrot's position is in the same position as the bunny or touches the bunny then the bunny's size should grow by half of its size. Help would be greatly appreciated.
Answer by hobofight101 · Jan 23, 2013 at 07:07 AM
can anyone help at all?
Hi There.
Please don't post comments as answers. Post comments by clicking the [add new comment] button, a window then open for you to type in. Answer fields are for answers only, as this is a knowledge base.
Here at Unity Answers, Answer means Solution, not Response.
You can convert this answer to a comment (or just edit your original question), you'll also get a better chance of getting an actual answer if the main list shows none or one answer in blue =]
Under the answer where it says edit | delete | more , click on more , then convert to comment
Also you don't have to wait for a moderator to approve a comment.