- Home /
OnTriggerEnter on child gives returns name child
When i use OnTriggerEnter function on a parent of a trigger. It returns the name of the trigger object.
function OnTriggerEnter(other: Collider){
if(isSelected){
Debug.Log("TRUSS SCRIPT: source "+ transform.name+" ontrigger "+other.name);
}
}
The trigger is a child object. And other.name gives me the name of the child. I don't need the name of the child object i need the name of the object where the child collides with.
Answer by yusolaifdfer · Jul 18, 2014 at 05:17 PM
Hahah well yeah that happens, This is called Compound Colliders. http://docs.unity3d.com/Documentation/Components/class-Rigidbody.html
Anyways, to solve this thing, Add a rigidbody to your child object, make it kinematic and make sure collision type is "Discrete". That should fix you up.
You should check out the link for more detailed info.
Your answer
![](https://koobas.hobune.stream/wayback/20220613154423im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
C - compare 2 char 0 Answers
how do i use gameObject.setactive with a bool?(my codes not working!) 3 Answers
clickable object 1 Answer
Is OnAudioFilterRead supported for flash? 1 Answer
No player movemnt HELP 0 Answers