- Home /
Question by
thedodgeruk · Jul 24, 2012 at 03:28 PM ·
parentchildhierarchydisconnect
inside a script is there a way to disconnect a child from its paretn in c#
i want to disconnect a rocket that is attached to a helicpter when it is fired , but it is connected in a hierarchy, so if a move the rocket and then move the helicpter , the rocket would still be attached, so how do i disconnect it within a script
Comment
Best Answer
Answer by whydoidoit · Jul 24, 2012 at 03:31 PM
Just set the rockets transform.parent = null.
cheers, not realise it was that simple , or were the code was , cheers
Your answer
Follow this Question
Related Questions
Make a simple tree 1 Answer
How can I find a unique sibling/parent/child in a specific hierarchy and not from all the scene? 1 Answer
Collider working but not firing OnCollisionXYZ (in parent object) 0 Answers
getting the object that the running script is attached to 1 Answer
Hierarchy question 1 Answer