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

Cinemachine axis not updating when in StateDrivenCamera

Discussion in 'Cinemachine' started by xinoHITO1, Jun 22, 2018.

  1. xinoHITO1

    xinoHITO1

    Joined:
    Jul 2, 2012
    Posts:
    33
    I recently updated my Cinemachine to version 2.2.0 from version 2.1.13 (both from the Package Manager) and it suddenly broke my game. I'm using Unity 2018.1.0f2.

    So in my project, I have a state-driven camera called "Camera Manager". The camera manager handles 5 FreeLookCameras. This is because when the player executes different actions the camera distance and offset to the target (the player) should change. The state-driven camera changes between these depending on the player's actions. I have a specific AnimatorController just for this StateDrivenCamera along with a script that updates this Animator.

    CMscreenshoot.png

    So I want each of these FreeLookCams to have their axis controls update constantly... even when the StateDrivenCamera is not on their state.

    The problem right now is that only the active state in the StateDrivenCam has it's axis updated... so when I change to another state... the camera rotates like crazy when I only want it to change distances or offset from the lookAt target.


    In the following screenshot, I'm in Play Mode. The current active state is the "Movement" camera. It's axis values (green rectangles) are being correctly updated... but when checking the "Red lock on" camera it shows that it's axis values (red rectangles) are NOT being updated at all.

    I thought that the changing the parameter "Standby Update" to "Always" would help... but it did nothing.

    cmScreenshoot2.png

    Also, one final thing to mention is that I'm using Rewired to handle my inputs. And I made this script to override Cinemachine's input axis to use Rewired axis instead of Unity's default one. But I really don't think this is a problem since I've been having this problem even before I added this script.

    cmCode.png

    Can anyone help me with this? Did they change something in version 2.2.0?
     
    Last edited: Jun 22, 2018
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Yes, in prior versions when a transition was made between FreeLooks with the same Follow target, the axis values were transferred from the outgoing vcam to the incoming one. That behaviour got dropped in the latest CM, perhaps inappropriately :oops: we'll look into putting it back. Thanks for your patience
     
  3. xinoHITO1

    xinoHITO1

    Joined:
    Jul 2, 2012
    Posts:
    33
    Thanks for the quick response @Gregoryl !! Yeah maybe it would be a good idea to include a checkbox for that either in the freelookcams or in the stateDrivenCam.

    Right now I'm glad I didn't break anything. I guess i can update the freeLookCams via script to apply the current axis values to the next camera state.