I’m working on a platform game, and my player has a CharacterController attached. I’m trying to respawn my player when it hits an enemy, and I’m using OnControllerColliderHit to detect the collisions. The problem is, the collision only works if the player is moving, otherwise the collision seems to fail when I tried to use OnCollisionEnter inside my enemy’s code, the respawn worked but my player kept falling through the scenario (apparently it stoped colliding)… I know that OnControllerColliderHit only works this way, so does anyone knows a way to detect my enemy’s collision?
Use Physics.Raycast (transform.position,transform.forward, hit, 5)
this might help you.