Identifying the GameObject collider that triggered hierarchical OnTriggerEnter event

Hi,
If you have a hierarchy of GameObjects, where the children have colliders but only the parent object has a RigidBody, then Unity will bubble the child collider events up, until it hits the RigidBody, then fires the OnTriggerEnter on the parent. That’s great and I can see which object COLLIDED (via the Collider parameter in the event). But how can I detect WHICH of the child colliders sent the event?

Thanks!

That data is inside the ContactPoint results from GetContact/GetContacts.

Apologize for digging, but since this answer comes up very early in Google search, for the sake of completion to Unity community.

Allow me to link to my answer on gamedev SO.
https://gamedev.stackexchange.com/a/185095/54452

2 Likes