Freelook camera skip in perspective

I’m making a concert application and use a freelook camera to do an orbit around the singer. In code, I control the X & Y axis settings to basically LERP around the avatar. Note that the avatar is usually animated and moving, but I’ve turned that off to limit my variables.

However, often (but not always) when the camera is ~185 degrees around its rotation, the perspective suddenly switches with a sudden change (not sure I’m using the correct words here so forgive me). You can see what I mean in this video:

I’ve tried a ton of settings, but am not sure how to solve my issue. Any help would be appreciated.
thank you,

Code and inspector screen shots follow:

    IEnumerator RotateOrbitCamera(CinemachineFreeLook freeLookCam)
    {
        freeLookCam.m_YAxis.Value = 0;
        freeLookCam.m_XAxis.Value = 0;

        float timePassed = 0;

        float currentY = 0;
        float maxY = 1;
        float currentX = 0;
        float maxX = 360;

        while(timePassed < orbitPanTime)
        {
            //Debug.Log($"ORBIT {timePassed / orbitPanTime}");
            freeLookCam.m_YAxis.Value = currentY;
            freeLookCam.m_XAxis.Value = currentX;
            freeLookCam.m_Lens.NearClipPlane = 0.1f;

            timePassed += Time.deltaTime;
            currentY = maxY * (timePassed / orbitPanTime);
            currentX = maxX * (timePassed / orbitPanTime);

            yield return null;
        }

        freeLookCam.m_YAxis.Value = 1;
        freeLookCam.m_XAxis.Value = 360;

        //??? do we like returning to main when done???
        yield return new WaitForSeconds(Random.Range(3,6));
        SetMainCamera(true);
    }

I think a better setup for you in this case would be using Tracked Dolly. Instead of controlling the input Axes, you would control the Path Position.

Setup:

  • Create a Tracked Dolly Camera. Right-click in the Hierarchy → Cinemachine → Dolly Camera with Track.

  • Modify the created Dolly Track, so that it is an orbit around your target. Make it looped.

  • Then, set your Look At target on your vcam.

  • Turn off Auto Dolly on your vcam’s Tracked Dolly body component.

Now you can modify the Path Position to orbit your target.

For an example, have a look at our sample scenes: Tracked Dolly → Dolly Auto, Tracked Dolly → Dolly Cart.

Does this happen when you change the value of the X Axis by hand in the inspector?

I’ve never seen that happen by hand. That said, in the code I’m adjusting the X & Y axes at the same time. That’s pretty hard to do by hand :).

Ill try the dolly camera, thx.

So I’ve replaced the freelook cam with the dolly cam you suggested. The good news is that the dolly cam is definitely a cleaner implementation. Unfortunately, the same skip is happening here as well.

The code, inspector image, and another video is below.
Thanks,
Jason

    IEnumerator RotateOrbitCamera(CinemachineVirtualCamera cam)
    {
        float timePassed = 0;
        float positionOnTrack = 0;
        CinemachineDollyCart cart = cam.Follow.GetComponent<CinemachineDollyCart>();

        while (timePassed < orbitPanTime)
        {
            cart.m_Position = positionOnTrack;

            timePassed += Time.deltaTime;
            positionOnTrack = 1 - (timePassed / orbitPanTime);

            yield return null;
        }

        yield return new WaitForSeconds(Random.Range(3,6));
        SetMainCamera(true);
    }

Could you send me a repro project? I’ll have a look.

What is your default blend time in the CM brain? I suspect that when the skip happens, you’re still blending. Try a really short blend time.

Thank you, the blend time seems to have been the issue. I’ve added a 2 second custom blend into the dolly camera and that solved the issue.