Search Unity

Cinemachine Free Look stop recenting

Discussion in 'Cinemachine' started by SunnyValleyStudio, May 29, 2020.

  1. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    67
    Hi!
    I have a setup where camera follows a player around - looking at its back. It retains this perspective when character is moving.
    I want to rotate the player when arrow left or right is pressed and make the camera stay in that position(not rotating to look at players back). It could also keep the standard free look rotation using mouse (in my setup).
    I think what I need is to stop recentring. I have tried m_RecenterToTargetHeading and m_XAxis.m_Recentering and nothing gives me the result i seek.
    I attach the cinemachine component screenshot that I have in my game.
    Does anyone knows how I can stop the cinemachine free look camera from rotating on X axis to look at the player in its default position?
    Thanks a lot!
    Peter
     

    Attached Files:

  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,726
    @SunnyValleyStudio The inspector screenshot you showed is for a FreeLook that will not do any x-axis recentering. You will be able to rotate the player, and the camera will not move.

    However, if you start moving the player's position, the camera will follow as though being pulled on a string - ultimately ending up at the player's back if the player is walking forwards. This is due to the binding mode, which is set to SimpleFollowWithWorldUp. If instead you want the camera to maintain a fixed worldspace offset from the player regardless of the player's motion or orientation, use the WorldSpace binding mode.
     
    WhiteTiger2011, bugbeeb and gooby429 like this.