- Home /
Parenting Transforms, Must (still) Set Parent at 0,0,0 ?
Still trying to understand the parent-child thing in Unity. It seems the short answer is that any child will move/rotate according to its parents, and will have their local origin at the center of the parent.
In the Unity manual, the Hints section for the page below mentions:
"When parenting Transforms, put the parent's location at 0,0,0 before applying the child. This will save you many headaches later."
http://unity3d.com/support/documentation/Components/class-Transform.html
I presume this means the parent only has to be at 0,0,0 during the parenting drag/drop operation in the IDE, and not all the time. I am not sure why the parent has to be at 0,0,0 for when this operation occurs. It seems pretty ad hoc - is this a Unity 2 bug that we don't have to worry about anymore in 3?
Answer by Eric5h5 · Dec 18, 2010 at 11:25 PM
I don't really know what the docs mean by that...it was never a problem to have the parent at any arbitrary location when adding a child. Unless there's something I'm completely overlooking, that line should be removed from the docs. They might have meant "rotation"...I could see that potentially being an issue if the parent was rotated and you didn't realize it when adding a child.
I can't think of any issues with that either. I often parent rotated objects because I want them to have some pre-set rotation rotation. Imho, that line really doesn't have a place. However, it can often be useful to set the childs location at 0, 0, 0 AFTER applying the child, as sometimes you want to reset the position relative to the parent.
Yeah, I was sort of grasping at straws with the rotation thing; it was all I could think of that made even a little bit of sense. ;)
Your answer
Follow this Question
Related Questions
Make a simple tree 1 Answer
Problem with child and parent. 1 Answer
iOS Instantiate transform as child -- positioning bug 2 Answers
How Do I Offset a Childs Transform? 3 Answers
Parenting from code doesn't really change the hierarchy 1 Answer