- Home /
Question by
PsychoDuckArcade · Apr 05, 2015 at 03:43 AM ·
collisiongameobjectcolliderparentchild
collision.gameObject returning parent.
I have a gameobject with a rigidbody but no collider. I have another object childed to the first with a collider but no rigidbody. When a moving object collides with the collider of the child object, in it's OnCollisionEnter collision.gameObject returns the parent, not the child like it's supposed to (http://docs.unity3d.com/ScriptReference/Collision.html).
Comment
Best Answer
Answer by PsychoDuckArcade · Apr 05, 2015 at 04:01 AM
Solved by using collision.collider.gameObject instead of collision.gameObject.
You saved me the hours I would need to find it out. Thank you very much 8)