Question by
Caleb_Bertrand · Jun 10, 2018 at 01:13 AM ·
triggerreferencing
How to Access the Collider Just Triggered.
I find it very strange that there is no way to access the current collider activated in an OnTriggerEnter
function. It gives you reference to the other collider, but there is absolutely no way to access the collider that is from the current game object. The thing is most of the time (if you only have one collider) you can just get a reference to it by GetComponent
. However, I have two Circle Colliders, and even though I can get a reference to both using GetComponents
, I have no way of knowing which one is triggering the function. How can I know which collider is triggering what?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612164448im_/https://answers.unity.com/themes/thub/images/avi.jpg)