Argon Assault, unexpected spins

I’ve created the route for my ship by using the right mouse button+WASD and “aligh with view” command and after corrected the smoother turning arcs in the curves. How these two systems coresponds? Sometimes, while I was using rotate tool to turn manually I’ve got some strange spinings for 360 degrees in timeline play mode. I was able to fix it in curves or just deleted the key, but I wonder why that was hapend?

Hi Umka,

What you experienced is a known and unsolveable mathematical problem. Unity internally works with quaternions while the frontend works with Euler angles. The conversion causes the strange spinnings because Unity used the “wrong” Euler angle in a keyframe.

By “wrong”, I mean “wrong” in regards to your animation, not “wrong” in a mathematical sense. For example, assuming the rotation is 0 and the player is pointing upwards in keyframe 1. In keyframe 2 is it supposed to be pointing to the left. The quaternion is unambiguous. However, for the same position, the Euler angle might be -90 or 270 or -450 or 630, and so on. All values are correct regarding the conversion but your ship suddenly rotates clockwise or counter-clockwise, which might be wrong in the context of your animation.

What you could try is to set the “Interpolation” of the animation to “Quaternion” or another value. See here. However, if that did not solve the problem, there is no other solution but fixing the Euler angles manually in the keyframes.

Did this make sense?


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms