Hi I´m a noob in Unity and I´m trying to figure out the bounce of object such as a ball, I´m crating a small game with springboards with different bounce force. Such as Springboard1 has the bounce of 4, springboard2 has the bounce of 8 and springboard3 has the bounce of 12. The springboard has to push the player with these different kinds of forces. I´ve tried everything and the ball does gain extra force but just bounces upwards. Anyone can help I´ve tried this code but no avail.
var snapjump : int = 8;
var microjump : int = 2;
var superjump : int = 13;
function OnCollisionEnter (other : Collision) {
if(other.gameObject.tag == "snapjump") {
rigidbody.velocity = Vector3.up * snapjump;
}
if(other.gameObject.tag == "microjump") {
rigidbody.velocity = Vector3.up * microjump;
}
if(other.gameObject.tag == "superjump") {
rigidbody.velocity = Vector3.up * superjump;
}
}
As you can see in the screenshot the springboards are purple but with different kind of tags.