An enemy and player with colliders only one of them get OnTriggerEnter

So an enemy and a player walks into a bar and then into each other :wink:

Now I have kinematic rigidbodies on both of them (also tried with just one of them) and when they collide only one of them gets OnTriggerEnter. Is this by design?

I can work around this quite easily by having logic for collisions in two places (the player and enemy scripts) but it messes up my code a little. So the question is, am I missing something here?

I am guessing that Unity only sends a message to the first collider or something to save performance? Is there any way to get around this? Is what I am seeing here correct?

EDIT:

After further research it seems that they both trigger when standing still. However if I move the player (i am not moving using physics but instead translating) I will get the OnTriggerEnter on the player but only sometimes on the enemy. Worth noting here is that both are moving at the same time.

Why is this happening? I guess it has to do with when and how collision checking is done when not using physics when moving stuff around?

EDIT2:

Nevermind about this one :slight_smile: Under certain circumstances I was destroying the Enemy script and because of that got the result I described.

Anyway what I have found out is that it should be called for both scrips :slight_smile: Just as you would expect!