Quantcast
Channel: Latest Questions by gdbjohnson
Viewing all articles
Browse latest Browse all 24

How to know which Collider fires Trigger event

$
0
0
I have an object hierarchy with multiple coliders, and the parent has a rigidbody on it. I have learned now that each collider will cascade it's collision messages up the hierarchy to the first rigidbody it finds. The method signature for collisions is: `OnTriggerEnter2D(Collider2D other)`, which allows me to know what has collided into my object. However, since I have multiple colliders on my object that could have generated this message, I don't currently know which part of my object was collided into. Is there an easy way to know which one?

Viewing all articles
Browse latest Browse all 24

Trending Articles