Search Unity

Cameras no longer snapping after being disabled/enabled

Discussion in 'Cinemachine' started by CDF, Aug 16, 2019.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Hey, has something changed with how virtual cameras snap when being disabled then enabled again?
    Using version 2.3.4

    My virtual camera is not resetting it's damping/easing values when I toggle it on/off.
    I'm using:

    virtualCamera.gameObject.SetActive(false);
    //move target
    virtualCamera.gameObject.SetActive(true);

    I also only have 1 virtual camera in the game.

    what happens is the camera lerps towards its current position to new target position rather than immediately snapping to new position, which it should... right?

    I'll get a bug report up soon
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Seems I have to wait just a single frame for the velocities/easing to reset and get the snap working.
    This does introduce a single frame flicker though
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    You could try calling vcam.OnTargetObjectWarped()
     
    Jiaquarium likes this.
  4. Jiaquarium

    Jiaquarium

    Joined:
    Mar 22, 2020
    Posts:
    45
    Wow this worked perfectly thank you!! Was running into the same issue.