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.