How to know which child collider triggered in parent?

by 40detectives   Last Updated June 07, 2019 00:13 AM - source

I have parent object with 3 children. Each children has one collider (BoxColliders actually) marked as triggers each one.

I want to know in a OnTriggerEnter on the parent side which collider was hit.

Similar to this question: How can I determine which Trigger is hit? But for 3D Colliders (not 2d). As you can see in the accepted answer they used Collider2D.IsTouching but it doesn't seem to exist any analogue method for a 3D Collider

If is not possible, what other solutions are there? What would be the recommended way? I would like to avoid the overhead from methods like CompareTag and SendMessage if possible.

http://answers.unity.com/answers/1206114/view.html



Related Questions




2d Character Crumbles after collision with platform

Updated April 26, 2019 09:13 AM

Every Item is colliding but 1

Updated May 22, 2017 20:13 PM