Hi guys!
I testing some collision, and i have a problem. I make this scenario:
The idea is, addforce by rigidbody, in the ball, he go ups, bounce wall, go down, bounce platformer, go up again and stays in this forever.
Every time the ball collide with something, in the console print “hit”.
The Script:
float speed = 10f;
// Use this for initialization
void Start () {
GetComponent<Rigidbody> ().velocity = Vector3.up * speed;
}
void OnCollisionExit (Collision Col)
{
if (Col.gameObject.tag != "Respawn") {
Debug.Log ("hit");
}
}
The Problem is…in the console only appears hit, in the first colission, all other they dont work. Why this happens? What i make wrong?