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:)
5 Answers
5
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.
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 
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
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
Excellent answer. This problem has been bugging me for a while also. Thank you for your contribution.
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 :)
– FLASHDENMARKthanks a bunch this worked out for me too
– DenisthegreatI 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.
– TheRedGuy90