- Home /
Animating: Object does not rotate as it should.
I'm using the Animation window to animate the main camera flying through my scene. This works well because the camera moves very smoothly and I can control the exact timing between each point, which is critical.
I've started by moving the camera around a sphere. Position works perfectly. However, at a certain point, the camera will do a 360 spin.
Imagine you're facing on a heading of 350 degrees, and you want to face at a heading of 10 degrees. Instead of turning to the right 20 degrees, the camera rotates to the left 340 degrees.
Worst case scenario, I re-arrange my scene into a hallway system in which the camera never looks back towards the start of the hallway. This option honestly disgusts me, but it might be what must be done.
Mid-case scenario, I add the 3 lines of code unity overlooked to the animation system. Is this even possible? How would I access the code?
Best case scenario, I am foolish and simply need to adjust a setting. What setting would that be? How do I get to it?
Answer by Navigatron · Jan 24, 2017 at 09:49 PM
Best-Case Scenario!
If anyone else is struggling with this problem, Here's what you need to do:
Right click "Rotation" on the left side of the animation pane
Hover "Interpolation"
Select Quaternion
If by any chance after this you experience a shaking effect, select the keyframes in question, right click, and select "flat".
Hey!
I had the same problems, and your answer is great! Cant you mark it as the "best answer" since its pretty much on point? It will help other people as it is marked as answered and your answer will be highlighted. (See the dude who did try to help even tho u got it yourself? ;) )
Also, just because im curious... Are you using (Local)EulerAngles in this specific case?
What is an animation pane, because all that you're talking about isn't in my unity
Answer by theANMATOR2b · Jan 25, 2017 at 03:07 AM
Which version of Unity are you using? I remember a similar 360 animation bug that was fixed in either 5.3 or 5.4.