- Home /
Simple animation problem
I have an empty gameobject for items and I am trying to animate it. When moving it downward and rotating it to a sword-swinging like animation it rotates sideways halfway through the animation, then back to the rotation I wanted.
No animations I've made so far have done this, how do I ensure that the object follows a straight path and rotates directly to the desired rotation? I have tried setting the curve settings to flat and others but nothing has worked. Changing the rotation to negative values can make it a bit better but then it starts to spin.
So, to be clear, your animation is a translation along one axis, combined with a rotation around one axis? And you then you observe, in the middle of the animation, additional rotation around a different axis? Does your intended animation continue during this time, or is it paused in some fashion? Also, are you using the Animations pane, or scripts, to perform the animation?
Yes what you said is correct. It is only 2 keyframes from a 0,0,0 rotation and it moves diagonally across the first person view like you would expect a sword to. It turns sideways ins$$anonymous$$d of just rotating directly to the set rotation. I'm using the animation window and manually dragging the gameobject in the scene view.
Edit: It is translating and rotating on all 3 axes though. And now even having 2 keyframes at the exact same values has the gameobject rotate 360 degrees... What the hell?
I'd say "vector3" versus "quartenion", but you're using the pane, so that's out. I next feel like you have some animations you didn't expect - make a new scene and add things as little as possible at a time, checking to see when it breaks.
Your answer
Follow this Question
Related Questions
Rotation in animation problem 0 Answers
Prefab Character position/rotation resets 0 Answers
Animation problem with rotation and position. 0 Answers
Do animation rotations refuse to accept negative values? 2 Answers
Manually animating using only rotations 0 Answers