This code works as it detects collision between a cube a floor and a Wall.
The problem is the cube I drop (like this video), is that I only detect the collsiion once with the wall and floor, even though the cube bounces around many times on the floor. Why is this?
http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/
void OnCollisionEnter(Collision collision) {
if (collision.gameObject.name=="Floor")
{
Debug.Log("Hit Floor");
}
if (collision.gameObject.name=="Wall")
{
Debug.Log("Hit wall");
}
}