Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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


    Unity Technologies

    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!