Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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