- Home /
C# Ignore Collision Trigger From Child
Is there a way to ignore the collision from a child? I have Both a child and the parent that have colliders set with is trigger set to true and the child keeps executing the parent's OnTriggerEnter function. I've tried separating them by assigning different tags but it still occurs.
Answer by RLin · Jul 21, 2015 at 01:18 AM
Tags do not affect collision detection, and unfortunately, there is currently no parameter that tells you information about the collider that called ontriggerenter. You have two choices: ether place the child on a separate layer and use the Layer collision matrix in the physics settings, or disable the child/just its collider.
Answer by NhojEntuna · Jul 21, 2015 at 05:48 AM
When you're assigning a GameObject to another making it a child of that GameObject meaning you're getting the attributes of that "parent" to the child making it the same. So in collisions when the collision wants to detect a certain object that child is also part of the object causing the collision to be TRUE.
One solution for that is to place the child object to a separate object and make it follow the parent so that it won't have the attributes that the parent has.
Your answer
Follow this Question
Related Questions
Collider not continuing to Ignore CharacterController after center changes. 0 Answers
Is it possible to detect different colliders with one script ? 1 Answer
Best way to detect specific collisions in child objects 2 Answers
Extracting child trigger from compound collision 0 Answers
Is it possible to check how much a trigger is filled by %? 1 Answer