How else can I have two triggers interact with each other?

I’m working on a game in which you damage enemies by flying through them. Naturally, I don’t want the enemies to collide with you, so I have them set as triggers. It works perfectly.

This works great, except I want to have environmental effects (i.e. a slow-mo grenade), and the easiest way I can think of doing this is with a trigger collider. This works for the player, but it would not be triggered on the enemies (both would have trigger colliders). How can I make the enemies interact with the slowdown effect?

I suppose a workaround would be to add a child component to the enemy, have it set to not interact with the player layer, and give it a non-trigger collider, but that seems like a non-ideal solution. I’ve also considered using an overlap capsule, but it seems inefficient to have it run over and over (not to mention the OnTriggerExit equivalent would be more of a pain).

If you give the enemies and the projectile kinematic rigidbodies, they should trigger each other’s triggers. Unity - Manual: Introduction to collision See the event matrix towards the bottom.

1 Like

The matrix really helps! I was looking for something like that but couldn’t find it.

When they say “Rigidbody Trigger Collider,” do you know if they’re referring to dynamic rigidbodies?

Yep, dynamic rigidbodies are assumed to be default there, but it sound like you’d want kinematic ones if you’re already controlling the enemies and projectiles through scripts and not through physics interactions.

1 Like