Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Camera lerps into place at the beginning of a scene

Discussion in 'Open Projects' started by vjs22334, Feb 5, 2021.

  1. vjs22334


    Oct 11, 2018
    Regarding This Issue:

    I think I have a fix. warping the vcam to the player after setting the target seems to work.

    Code (CSharp):
    1. public void SetupProtagonistVirtualCamera(Transform target)
    2. {
    3.   freeLookVCam.Follow = target;
    4.   freeLookVCam.LookAt = target;
    5.   freeLookVCam.OnTargetObjectWarped(target,target.position-freeLookVCam.transform.position);
    6. }
    you can see the behaviour in the video in this comment:

    I guess the distance can be adjusted a bit to warp the camera to a set distance away from the player. But based on my testing warping the camera directly into the player's position is the most consistent in tems of camera movement

    is this behaviour ok? can anyone think of any potential problems?
    Last edited: Feb 5, 2021
  2. cirocontinisio


    Jun 20, 2016
    No, I think it's a great fix and, to be honest, I didn't know of the existence of that function! I guess the Cinemachine developers foresaw this potential use case.

    We can then tweak the position later on, but for now, this is a great and probably unharmful fix to the issue.
    Yes, if you could make a PR it would be great! Thanks!