- Home /
Does onTriggerEnter work with child colliders?
I have colliders on head,chest, and hand of a skeleton and there are rigidbodies with isKinematic on all three also.
A script with onTriggerEnter is on the chest and head. hand and head will register a collision but hand and chest will not. The only difference is that hand is a child of chest but not of head.
The skeleton structure is
body-->hip-->chest-->arm-->hand
body-->hip-->chest-->neck-->head
Is there some fundamental reason that a trigger is ignored if it is on a child. Is there a workaround?
Can you tell me again which one will register the collision and which one won't because i think you got something confused there. You said hand + head will register colllision and hand + chest won't. Is that right because you mention hand twice.
Generaly speaking from what i know if a GO hits a collider the GO the collider is attached to will execute a OnCollisionEnter/OnTriggerEnter function if it has one. I don't know something about weird behaviour when it's a child.
Btw. If you're talking about a bullet for example i would recommend you to have a OnCollisonEnter function on the bullet and if it collides with the "player" it will call a function on the player.root.