- Home /
Animated object changes position when animation is played.
Hi, so I am learning object animation an run in to a problem: my animated object is changing its coordinates on single axes, when animation is played. I created a simple object in 3d Max, animated it using bones + one HI solver and imported it in my unity scene. I did not export to .fbx, but just dropped the .max file in assets folder. I named the split animations, and they work fine, except right before the animation is played for the first time, object changes position on y axes and stays there. Is there something I missed?
Just noticed that the object that I am trying to animate is put in the wrong coordinates when I drag in to the scene in the first place. For example if I drag it in the scene and in the transform component type in coordinates 0,0,0 it is not positioned an 0,0,0 but a bit further down the y axes, but once the animation is played, it jumps to 0,0,0 and plays there as it should. I also wrote a simple script (transform.position = Vector3(0, 0, 0);) in the update function and put that on the object, but it did not move the object in the corect position until animation was played...
Answer by Eddy Johnson · Dec 29, 2010 at 12:27 AM
So after lot of trying I found out that it was the root bone of my bone structure that was causing the trouble. When I collapsed the trajectories of every bone except the root bone, the object imported at the correct position. So a "cheap" workaround for the problem is just adding another bone and link the root bone to it. It seems to work, but somehow I still have the feeling that I screwed up somewhere...
No, parenting your root to extra joint (either in your modeling tool or even better in Unity) is the correct solution.
how to manage another extra joint for parenting in unity?
i mean how to parent my hip bone(root joint) to another extra bone inside unity?
$$anonymous$$y character was offsetting on play and I just created an empty game object in my character and dragged the root bone "hips" into it. Seemed to work.