- Home /
The question is answered, right answer was accepted; also Outdated.
Animation position problem
Hello all :)
I have made a simple animation using Unitys animation window. The problem is when i want to play the animation from a different position then where it was created it automaticly "jump" to the position where it was created.
E.g. if I made a animation at the position: X = 0, Y = 0 and z = 0, then move the object with the animation to a different position then 0,0,0 it automaticly snaps to the position where the animation orginally was created.
Is there a way to prevent that?
Thank you:)
Answer by Bunny83 · Mar 08, 2011 at 07:39 PM
Animation curves are applied to localPosition / localRotation. Don't animate the root object. The animation should be applied to child objects only. Unity doesn't directly support motion delta in animations that's why you have to animate in place.
If you animated only childobjects, make sure that the parent object don't have animation curves. You can simply delete them. Otherwise you have toput your object together with the animation into an empty GameObject.
Huh, wierd it worked... that is good i guess, but if something can be worked around this easily, why not just make it a feature?
But anyway thank you it worked :)
I came across this, and my child object is the only object being animated, with no curves on my parent object. I coded the child object to play the animation, and it still snaps back. If anybody has advice on where to go from here, please feel free to message me privately. Thanks in advance.
Answer by Rocky46 · May 20, 2013 at 12:43 PM
I had this very same problem (moving to 0,0,0 worldspace) uncheck "apply root motion" on the animator.
My animator component is attached my model, my model is a child object of first person controller. hope this helps :)
Really helps me. apply root motion makes strange behaviour for me
Answer by kenseiden · Jun 09, 2017 at 08:58 PM
this was a real pain for me but after some deep digging I discovered you need to check Apply Root Motion field and Generate Root Motion by going to Animation > 2x Click on your animation.
Hope that helps
Dear Kenseiden, what do you mean by click on your animation? :)
Answer by LongGood · Mar 26, 2014 at 07:56 AM
I do need joint's globalposition for comparison. My animation is applied to 3D mode, each component have the hierarchy. if I follow the suggestion move all the component as child to a empty gameobject, then the animation will be fail.
any suggestion?many thanks
Answer by Rockkevin · Jan 25, 2017 at 07:52 AM
Excellent answer. This problem has been bugging me for a while also. Thank you for your contribution.