- Home /
Adding child repositions parent tranform
I am currently working on building an animated door which can be reused through a scene. Based on the tutorials I've watched, in order to get a door to animate properly, I need to first have an empty game object ("hinge") positioned along the edge of the door I want to rotate around. With that in place, I then add the door mesh I want to use (in this instance, an imported .fbx) as a child of the Hinge object. The theory is that I will rotate the hinge and that will rotate the door mesh around the correct point.
The problem I'm having is that, after creating the Hinge object and positioning it where I need it, I go to add the mesh and it repositions the transform of the hinge object to be located at the center of the door panel; then, when I try to move the hinge transform, it moves the whole door (which is what I'm going for, except with the hinge at the door's edge rather than the door's center point.)
Has anyone else run into this problem?
I've experimented with the problem a bit and have some more information. The problem doesn't happen when I make an empty object the child of an empty object, but as soon as any layer of the setup (child or parent) receives a mesh component (renderer or filter) the transform position resets to match the center point of the added mesh.
Answer by Powdered_sugar · Feb 11, 2014 at 05:55 PM
Well, I figured it out. I had the tool handle placement option set to Center rather than Pivot >_>
Now it's time to figure out how to rotate it around that pivot point...
Your answer
Follow this Question
Related Questions
Animating sliding door, rotation problem 2 Answers
Door opening in the wrong direction..... 0 Answers
Fixing pivot points with second gameObject workaround 1 Answer
Door Movement Animation 3 Answers
Help: Making an object face a target 2 Answers