- Home /
Moving In Hierarchy
Can I move stuff around in the hierarchy from code? I've got a sword object that will be instantiated and I need the make it the child of the right hand in my Mecanim player rig.
Comment
Best Answer
Answer by InfiniBuzz · Aug 14, 2013 at 02:25 PM
Hi
You can set the instantiated object's parent:
clone = Instantiate(objectToInstantiate, pos, rotation);
clone.transform.parent = parentTransform;
hope it helps
Thanks So $$anonymous$$uch,
A couple days ago I had the same problem and spent hours try to figure it out.