Free Look camera gimbal lock issue

I have 2 “Free Look” cameras in my scene that I’m trying to switch between. They are both almost identical, with the only difference being the “Y Axis” value (0 vs 1). I need extra control for the cameras, so I need to have 2 of these.

When the “X Axis” value of these cameras is 180 and I activate the higher priority camera, there seems to be a gimbal locking problem where there is noticeable jitter in the camera for 1 frame. This can also be seen in the editor as the Z position suddenly changes for 1 frame, before continuing as I would expect.

This does not occur when disabling the higher priority camera and it also does not occur when the “X Axis” value is 0. This does seem to happen only with values near 180 for the “X Axis”.

Here is a sample project I created with just the two cameras in a scene. The jitter is hard to notice in this lightweight project, but it does exist. The Z position changing in the editor is easier to observe. Just enable/disable the higher priority camera.

https://drive.google.com/file/d/11M-FpFawZKCJX92_R2ow_LY0FZUDov5X/view?usp=sharing

I am on Unity 2020.3 and I am using the latest version of Cinemachine.

Is this a known issue, do I have my cameras set up incorrectly, or is there a workaround? Thanks!

Thank you for the repro project and description. We’ll investigate the issue.

Thanks! A small note on this, I was apparently on an outdated version of Chinemachine (2.6.11). My Unity Package Manager never recognized any Cinemachine updates, so I had to manually change the manifest.json.

I am now on the latest available version (2.8.4) and the same exact issue is still reproducible.

Bumping this to see if there have been any updates on what the solution would be? Or would this be better as bug report?

It’s on our todo list. We could reproduce the bug. :wink:

1 Like

This issue is fixed in CM 2.8.15

1 Like