Character controller and colliders neither set off 'OnCollision' nor ' 'OnTrigger'; are ridigbodies mandatory?

My npcs use character controllers and colliders, and I want to detect if the npc bumps into any of my static objects that also have colliders.

OnCollisionEnter and OnTriggerEnter don't fire if neither of these have a rigidbody attached. Is a rigidbody absolutely necessary for this?

On a side note, the unity documentation says "You use Character Controllers if you want to make a humanoid character. This could be the main character in a third person platformer, FPS shooter or any enemy characters." So...how am I supposed to properly handle collisions if OnCollisionEnter and OnTriggerEnter also expect a rigidbody to be attached?

1 Answer

1

Use OnControllerColliderHit for character controllers.

Thank you, I feel silly now for forgetting about that.

Don't worry, so did I.