I am trying to make a sphere collide with a terrain. My sphere is having a sphere collider and a rigid body attached to it. For the sphere collider ,the ‘is trigger’ is unchecked and for the rigid body ‘is kinematic’ is unchecked while the ‘gravity’ is checked.
For the terrain, in the terrain collider the ‘is trigger’ checkbox is unchecked again.
My script attached to the sphere is as follows :
void OnCollisionEnter(Collision collision)
{
Debug.Log("Inside OnCollisionEnter ");
if(collision.gameObject.tag == "Terrain")
{
Debug.Log("Hit !!");
}
}
The sphere does drop down and collide with the terrain but this code isn’t getting called at all !!