Why does OnCollisionEnter not work between a character controller and a rigidbody?

I am building a game where I have a weapon that shoots a projectile (with a collider and rigidbody), and an enemy with a character controller. In the enemy script, I have a OnCollisionEnter function that detects collisions between the projectile and the enemy.

When I shoot the projectile, it simply bounces off the enemy (so the collider is working). However, the OnCollisionEnter function never executes.

Is there any reason why the collision would not be detected? The strangest part is that the collisions were working previously and now they don’t for some unknown reason.

I used OnControllerColliderHit and it works fine now.

That’s not a general solution, though – OnControllerColliderHit only fires when your character controller moves into something. It won’t detect, for example, when your character is just standing there and gets shot by something.

I’ve just discovered this issue myself, and I’m still looking for a solution.

Got same problem, OnControllerColliderHit works, colliders working, but OnCollisionEnter never executes. No info in whole internet( If you find a solution - pls tell me

Place a second collider on the object you want your player to collide with and set it as a trigger.

Detect the collison FROM the object, checking the tag of the colliding object ( the player in this case ).

Then handle as needed.