Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to clamp the Y-Axis of Cinemachine FreeLook Camera

Discussion in 'Cinemachine' started by Krooq, Oct 31, 2022.

  1. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    180
    How can I clamp the Y-Axis of the Cinemachine FreeLook Camera?
    This is useful to prevent looking directly down or limit the tilt so the camera cannot look upwards.
    I do not want to change the orbit parameters because the shape is already not quite spherical and changing them squishes it more.

    I'm actually after a pretty basic "top-hemisphere", z-up, orbital camera with zoom, tracking and damping, but it seems pretty hard to achieve this with Cinemachine without jankiness.
    Perhaps there is a better way?
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    I think it would be easier to achieve that with 3rdPersonFollow using an approach that is close to what you see in this video:


    Changing Freelook's rig setup would also be a solution.
     
    Last edited: Oct 31, 2022
    Krooq likes this.
  3. mainver01

    mainver01

    Joined:
    Dec 31, 2022
    Posts:
    1
    upload_2023-5-10_12-42-27.png
    For anyone has same problem (use cinemachine freelook camera to 3rd person), in Cinemachine Freelook camera, find Orbits, change Binding mode to World space. Change "height" of TopRig and BottomRig to clamp camera's Y axis.
    You can see gizmos circle like this upload_2023-5-10_12-47-38.png