OnCollisionEnter does not work

Hi everyone, I have not so serious problem but I tried almost everything and it does not work. I have a player, This is my player.

, and I have a floor object, this is my floor,
I have the following function in script which is attached to floor

function OnCollisionEnter(other : Collision){

my player walks over the floor
but it does not write anything in console, I tried many things but I could not fix it, if anyone can please help me.

You could turn it around and check the collision on the player. To do so add a script to the player like this:

function OnControllerColliderHit (hit : ControllerColliderHit) {

Take into account that this way you will be checking if the player has had a collision with the floor instead of checking if the floor has had a collision with the player.

OnCollisionEnter only happens when collision happens but AND it there was no collision inprevious FixedUpdate.

If you want to check if collision is still happening use OnCollisionStay.

Other than that, you dont want to use rigidbody on gameObject that hac character controller. Chose one on another, otherwise wierd thigs are going to be happening.

Either use rigid body or use Character controller. Although you can use both at a time but they produce unexpected results.

You need to have a collider on the player too. Check Rigidbody Compound colliders in case you work with a hierachy of objects for the player.