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. Dismiss Notice

Cinemachine Virtual Camera Dutch Issue

Discussion in 'Editor & General Support' started by JungaBoon, Mar 20, 2021.

  1. JungaBoon

    JungaBoon

    Joined:
    Aug 4, 2020
    Posts:
    17
    Hi,

    I have a basic First-Person Rigidbody controller set up and I'm trying to get it working with a Cinemachine Virtual Camera. I have a Main Cam that renders the world and another Camera that's parented to it which renders the Player's hands.

    There is a setting called Dutch in the Cinemachine Virtual Camera that I would like to use for certain wall run maneuvers, but for some reason, whenever I use the slider, the camera would keep rolling in whatever direction it is going in regardless of the value of the actual slider.





    I would like to know why this is doing this. Thanks.

    Edit: I didn't realize there was a Cinemachine sub-forum. Mods please move this to that sub-forum, thank you.
     
    Last edited: Mar 20, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,756
    The general solution to this, irrespective of Cinemachine or whatever, is to introduce a fresh empty gameObject that tracks the original object's position, but NOT its rotation. Then Cinemachine would be told to track that empty object. This is one primary way to detach portions of positional / rotational information from different entities. For instance if you were following a tumbling ball (rolling ball game), you wouldn't want the camera parented to the ball or else you'd get pretty seasick pretty quickly. Making a proxy that tracks the ball's position only, not its rotation, is one way to address this.
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    @JungaBoon Dutch will always roll around camera forward. What exactly do you want to do instead?
     
  4. JungaBoon

    JungaBoon

    Joined:
    Aug 4, 2020
    Posts:
    17
    The issue I was facing was that the dutch value would keep applying every frame, so it would keep rotating, and the actual number wasn't indicative of the rotation degree. I got it working though. The Cinemachine Cam was initially attached to the main Cam, which was causing the issue.
     
    Gregoryl likes this.
  5. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    143
    hey man , i though that my question is cinemachine dutch related so i can ask it here :
    is there any workaround to make the dutch a 360 roll instead of clamping between 180 and -180?
    im working on a cinematic 2.5d game and i need some 360 rolls in some cases
    i will appreciate if you can help me with this.

    ps: never mind i did it , when i saw the clamp values i though its impossible to change beyond those values even through code , but i was wrong we can change them with any number we want
    thanks
     
    Last edited: Mar 7, 2022