This code works for collisions with a wall but not with the Floor which is the Terrain.
I dont get an error but nothing happens when I drop a cube on the terrain unless it hits the wall?
void OnCollisionEnter(Collision collision) {
if (collision.gameObject.name=="Wall")
{
Debug.Log("Hit Wall");
}
if (collision.gameObject.name=="Floor")
{
Debug.Log("Hit Floor");
}
}