Sorry I haven’t stated the issue correctly. In most cases things work fine, but I spent some time and I mapped out all the combinations of hitting colliders and it appears only Case 4 has the issue/bug.
In Case 4 OnTriggerEnter is not called on the child GameObjects.
This only works in Case 1 and Case 2. This does not work in Case 4 because OnTriggerEnter is not called on child GameObjects.
Case 1:
Self Object: Child Trigger Colliders (with parent Rigidbody)
Other Object: Trigger Collider
Result:
OnTriggerEnter called on Parent Rigidbody GameObject?: YES
OnTriggerEnter called on Child Collider GameObject: YES
-Since the Self Object receives OnTriggerEnter callback both at the parent Rigidbody object and at the child collider object the ambiguous callback at the parent Rigidbody can be ignored. Placing a script on each child object lets you listen for OnTriggerEnter callbacks and allows you to differentiate which collider was hit. This works as expected.
Case 2:
Self Object: Child Trigger Colliders (with parent Rigidbody)
Other Object: Non-Trigger Collider
Result:
OnTriggerEnter called on Parent Rigidbody GameObject?: YES
OnTriggerEnter called on Child Collider GameObject: YES
-Works as expected (same as Case 1)
Case 3:
Self Object: Child Non-Trigger Colliders (with parent Rigidbody)
Other Object: Non-Trigger Collider
Result:
OnCollisionEnter called on Parent Rigidbody GameObject?: YES
OnCollisionEnter called on Child Collider GameObject: NO
-OnCollisionEnter callback is invoked only on the parent Rigidbody GameObject and not the child. However, the Collision data class that is passed in the parents OnCollisionEnter callback contains contact information that provides information on both self and other colliders. Self and other collider information can be extracted by collision.contacts[0].thisCollider and collision.contacts[0].otherCollider respectively. This works as expected.
Case 4:
Self Object: Child Non-Trigger Colliders (with parent Rigidbody)
Other Object: Trigger Collider
Result:
OnTriggerEnter called on Parent Rigidbody GameObject?: YES
OnTriggerEnter called on Child Collider GameObject: NO!!! (THIS IS THE ISSUE!)
-Case 4 does not behave like Case 1 and Case 2. This is a OnTriggerEnter callback, and not an OnCollisionEnter callback, there is no Collision data to allow access to collision.contacts[0].thisCollider like in Case 3. This is not working as I would expect because you are told that your object triggered with another collider… but you have no idea which self collider hit it (it could be the parent or any of the children).
After some searching it seems other people have ran into this same problem. Not sure where it ranks in priority in your list of issues/bugs. If you do see this as a significant enough issue to warrant a change I would suggest a new overloaded OnTriggerEnter (TriggerData) callback where TriggerData contains information about both self and other colliders similar how the OnCollisionEnter callback provides a Collision data class.