collision with character controller

Hi!

I have a problem that i can not get over with and could not find answe anywhere.

I’ve got a character controller on my player and i would like to detect the collision with an object. I put a box collider on the object and trying to detect the collision with the OnCollisionEnter function.

However, i just can not reach the collider with my character controller and i think it is because of the skin width property of the character controller. I can see in scene view that the controller and the box collider can not reach each other because of it. If i decrease the skin width it they can move closer but cant collide.

So the question is: how can i detect this kind of collisions?

Thanks in advance!

You cannot detect a collision with a CharacterController using OnCollisionEnter. You can use the OnControllerColliderHit() callback, but the script must be on the CharacterController object.