collisions not working

Hi,

I cant detect collision with a cube with a rigidbody and my character controller. This script is on the cube and the name of my controller is ‘player’.
I am not sure why I dont get anything when i walk into the cube or even jump on the cube.

The ontrigger works when i click is trigger in inspector.


void OnCollisionEnter(Collision hit)
 {
	print (hit.gameObject.name);
	if (hit.gameObject.name=="player")
	{
		print ("cube hit");
	}
  }

I found this post

OnCollisionEnter is only for rigidbodies, it won’t work with character controllers. For those you can use OnControllerColliderHit.