Search Unity

Question Camera Rotation Animation Interpolates Odd Spinning

Discussion in 'Animation' started by ThatProgrammerJack, May 15, 2022.

  1. ThatProgrammerJack

    ThatProgrammerJack

    Joined:
    Jan 6, 2019
    Posts:
    32
    EDIT: Solved the problem by rotating a “container” object on one axis and rotating its child, the camera, on a different axis.



    ORIGINAL

    I'm animating a "wakeup" sequence wherein the main camera rotates to appear as though the player is looking around. I added an initial keyframe to set the camera position on a bed pillow away from the player body (which won't be visible; it's a first-person game) and rotate it up (x-axis -85 degrees) to look at the ceiling.

    All was okay at that point.

    I then added another keyframe after several seconds to rotate the camera on the z-axis to look at the right wall, but when I rotated on the z-axis gizmo, it changed the values of all three axes. I thought it might be fine as the animation would likely handle the interpolation fine. However, when I played the animation to look from up to right as though lying down and looking to the right, the camera spun around before settling on the end position.

    How can I fix this? I know that each axis will rotate as I am rotating somewhat "between" the default origins of the axes, but why do the Timeline curves do such a poor job of interpolating this?
     
    Last edited: May 16, 2022