- Home /
How can I de-parent an object from another??
How can I de-parent an object from another?? i MEAN, if I have an object i which there are others, how can I deparent them??
ops, I'm really sorry, but why did you put me a thumb down? I didn't see it!!!
I'm not sure why the ppl vote this down, but i think because:
There have been similar questions before
Your question isn't clear whether you want to do the detaching via script or manually in the editor.
You could edit your question to add some more details on what you want to do and where. $$anonymous$$aybe add some scripts/code snippets you've already tried. Also a quite useful information would be the (scripting-) language you prefer.
Downvoting without a comment why is not good practise. $$anonymous$$aybe if you improve the question they take it back.
Answer by Joshua · Jun 07, 2011 at 03:09 PM
If you don't want to detach children but de-parent an object (not sure from your question) you can simply use transform.parent = null;
Answer by Retribution · Jun 07, 2011 at 02:24 PM
Are you looking to do this through a script at runtime? Or are you wanting to do this through the editor/inspector?
If you're doing this through a script, you can use Transform.DetachChildren. Which script you would call this in would depend on which children/parents you want to be separated. The documentation for that is here: DetachChildren
If you want to do this through the editor, its a simple drag-and-drop for the items you wish to separate. Just click and drag the object out from beneath the parent, and drop it somewhere in the Hierarchy view.
Hope this helps
Answer by flaviusxvii · Jun 07, 2011 at 02:21 PM
http://unity3d.com/support/documentation/ScriptReference/Transform.DetachChildren.html
PLEASE try searching first. This is a clearly documented function on the Transform page of the scripting reference.