Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Cinemachine Freelook Camera - Camera acts weird for 1-2 frames when teleporting player

Discussion in 'Cinemachine' started by jeanmichelmorin, Jul 25, 2023.

  1. jeanmichelmorin

    jeanmichelmorin

    Joined:
    Jun 7, 2018
    Posts:
    5
    When I recorded the video, it didn't capture the glitch. It seems to be happening SO FAST that only I can see it when playing around with Unity, but my screen recorder cannot see it...

    EDIT: This is weird, I tried setting very low FPS for my game and even then I can still see it. I still cannot capture it throught my screen recorder though. (???)

    Anyways, basically what I'm doing is grabbing a ledge and climbing on top of a platform. Once I'm done with the climbing animation, I teleport the player on top of it. When this happens, for 1-2 frames my camera freaks out and then becomes normal. It's very annoying for the eyes. How can I make these 1-2 frames smoother upon teleporting the player? This is my line that teleports my player.

    transform.position = grabTeleport.position;
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    A better description of the behaviour might help here :)

    One thought: if the camera is tracking the player and then the player is teleported, the camera thinks that the player has moved very quickly and if it has damping then it will try to catch up. If you want the camera to teleport along with the player, you need to call vcam.OnTargetObjectWarped().

    https://docs.unity3d.com/Packages/c...aBase_OnTargetObjectWarped_Transform_Vector3_