Search Unity

Immediately Move To Offset Position Function?

Discussion in 'Cinemachine' started by deekpyro, Aug 4, 2017.

  1. deekpyro

    deekpyro

    Joined:
    Oct 16, 2012
    Posts:
    63
    For VirtualCameras that have a follow target or look at target sometimes during gameplay I want them to immediately move to their new position when the follow/look at target changes or when their target object is reset and moves across the world. Typically I do this for a non-visible camera that I want to cut/transition to.

    In my own camera rig system I had a function that would do that. Is the only way to do this in Cinemachine setting the VirtualCamera's X/Y/Z dampening to zero for one frame and then restoring those values the next frame?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,323
    You can do it by disabling then re-enabling the vcam's gameObject. When a vcam is enabled, it snaps to the target position, without damping.
     
    deekpyro likes this.
unityunity