Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

CMFreelook + Z-axis rotation(Dutch)

Discussion in 'Cinemachine' started by canis, May 16, 2018.

  1. canis

    canis

    Joined:
    Oct 25, 2013
    Posts:
    79
    in CMFreelook, we have Top/Middle/Bottom 3 different virtual camera (VC).
    I want to apply a little bit z-axis rotation, which call "Dutch" in VC Lens setting.

    however my problem is I want to control the rotation lerp timing & percentage between Middle <-> Bottom VC


    currently the effect simply just lerp between 2 different setting.
    what I really wanted to do is apply Dutch at the end of last 20%.
    e.g. AnimationCurve

    Q1) I wonder if there is any easy way to achieve the same result without coding ?

    Q2) if we must do it by create a helper script, how to identify the VC active state and percentage between those VC rig ?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Yes, it's just doing a lerp. You'll need to write some custom code to get what you're looking for. Your script should monitor CinbemachineFreeLook.m_YAxis.Value. 0 is top rig, 0.5 is middle rig, and 1 is bottom rig.

    I would attach a custom script to the FreeLook itself, get its bottom rig, and poke that rig's Lens setting in response to the value being monitored.
     
    canis likes this.
  3. canis

    canis

    Joined:
    Oct 25, 2013
    Posts:
    79
    Thanks for pointing me in that direction.