- Home /
Question by
thedodgeruk · Nov 05, 2012 at 10:12 PM ·
prefabattach
is there a way to do this through script?
as it can be seen by the picture
the apache has a child gameobject
is there a way through script in the apache to create a prefab and attach it like the"PivotPoint" in the picture?
Comment
Best Answer
Answer by DaveA · Nov 05, 2012 at 10:33 PM
Create it:
http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.InstantiatePrefab.html
Parent it:
http://docs.unity3d.com/Documentation/ScriptReference/Transform-parent.html
cheers , i not think it would be as straightforward as that
It's slightly not intuitive that the transform parent-child relationship is THE parent child relationship. If you wanted to organize objects as parent-child without spatially relating them this way, you'd have to do it through some other container object.