# OnTriggerEnter : is it called in both collider object?

I've 2 object: a Player and a Bonus object.

In both script I've "OnTriggerEnter" script.

In Player OnTrigger I: Take Bonus value and add it to my Player (health, point, ammo)

In Bonus OnTrigger I: Play audio (when take it), Play Particle System and so on...

But, it seems it's called only Player's OnTriggerEnter ... Why ?

In Unity, if I have OnCollision/OnTrigger enter in both object, which event is called ? Both ?

Thanks

• please post the settings of each collider and rigidbody for your test Dec 11, 2017 at 21:24
• Please check if both colliders have "IS TRIGGER" flag checked. Dec 12, 2017 at 8:18
• Is there a rigidbody, is it the only rigidbody in that hierarchy? Dec 12, 2017 at 8:55
• Its been a long time but as far as I remember OnCollisionEnter or OnTriggerEnter will be executed when Rigidbody is attached to that object. Dec 12, 2017 at 19:23

In order to fire onTrigger, you need to have colliders in both game objects with at least one of them with a rigidbody and with at least one of them with isTrigger set to true.
When that's the case, the OnTriggerEnter is called on all game objects involved if you have the OnTriggerEnter() function written in the scripts attached to them.
It doesn't matter which one has the rigidbody, or which one has isTrigger set to true. You can mix and match the settings in any way you want.
You can also have both object with isTrigger set to true. If you are having issues, you may have misspelled the function call on the bonus object.