- Home /
Question by
brandon199511 · Jan 21, 2012 at 06:18 AM ·
raycastparentparentinghit
Parenting a Parent?
Instead of parenting what was hit with the manager with the script on it, how would you make the parent of the object that was hit parent up with the manager with the script?
Hit object -> Take parent of hit object -> parent the parent with the manager
so far this parents the object that was hit... hitIt.parent = transform;
Comment
Answer by digitalConundrum · Jan 21, 2012 at 06:29 AM
Not entirely sure what you're asking, but I think what you want is :
hitIt.transform.parent.parent=manager.transform.
If that isnt what you wanted check this out, the script reference is your friend:
http://unity3d.com/support/documentation/ScriptReference/Transform-parent.html