Two Character Controllers Colliding with each other

Hi all,

I know this question has been asked numerous times, but I haven’t found a really concrete answer. In the game I’m making, the player and the AI both have character controllers and nothing happens inside OnControllerColliderHit when they collide. Is there a workaround or something that can get this to work? I know I can just switch the AI to rigidbodies and I’m sure the problem would just solve itself, but I’d rather not do that unless I absolutely have to.

Any help would be greatly appreciated. Thanks!

2 character controllers will never collide (physically they will block each other, but no message is sent).
Your options are things like, add trigger volumes to each, which monitor OnTriggerEnter

By trigger volumes you mean rigidbodies right? That won’t interfere with other collisions? (i.e The character controller and its collision with waypoints)

No i mean trigger colliders. add a sphere/box/capsule collider, and tick trigger. It doesnt cause any physics interactions, but does react to other colliders entering it’s volume

I use this trigger solution on my project and it works fine, just be careful if you are allowing collisions between triggers or between triggers and RayCasts.

If I give both the player and the AI trigger colliders then how would I be careful?

Re: triggers triggering each other, just check for tag on enter
Re: raycasts, put the triggers on their own layers, and just layermask the raycasts

Ok, that makes sense.

Alright to recap:

Add a collider to the object itself, don’t make it a child

Handle my current collisions normally using OnControllerColliderHit and if the same happens in OnTriggerEnter just check for tags.

Sorry if I seem annoying, just want to make sure I have this correct.

should be Add a collider to the object itself, don’t make it a child and make sure the “IsTrigger” option is selected for that collider.

Thanks everyone. I really appreciate the help. Happy Easter.