Cinemachine 3.1.2 weird FPS-Camera rotation

Hello,

my goal: the player should be able to switch between a FreeLook- and a FPS- and a TPS camera.

My setup: all 3 cameras are CinemachineCameras and work as intended. The player object has tracking-targets. A cameramanager-script implements the camerachanges.

Problem 1: Moving the FreeLookCam rotates the FPS-cam, too. I found a solution by disabling the InputAxisControllerComponent of the FPS-cam. Maybe there is a better way to do this.

Problem 2: Turning the player in TPS-mode turns the FPS-cam only half the way with FPS-InputAxisController enabled. The TPS-cam has no InputAxisControllerComponent.

Rotating the FPS-cam by scripting was not successful.

Maybe the screens are helpfull to understand the problem…

Startingpoint - FreeLookCam active:

Changing to FPS-cam, rotating Player-Object in +x-direction:

Switch to TPS-cam, turning Player-Object back - roundabout 45 Degrees:

Back to FPS-Cam, the rotation should be the same as those of the Player Object…

Relevant code:


Debug.Log("CameraManager - ChangeCam - fpscamrotation: " + fpsCam.transform.localEulerAngles);
Debug.Log("CameraManager - ChangeCam - playerrotation: " + player.transform.localEulerAngles);                    
fpsCam.transform.rotation = player.transform.rotation;                    
Debug.Log("CameraManager - ChangeCam - playerrotation end: " + player.transform.localEulerAngles);
Debug.Log("CameraManager - ChangeCam - fpscamrotation end: " + fpsCam.transform.localEulerAngles);

Thanks

Would you be willing to send me this test project? It will be much easier to understand that way.

100%, I have thought about this too, It almost seems as though the code is changing betwen a local transform and a “universal” transform… I have read the code and cannot for the life of me see where. You an I both know there is a difference between localEulerAngles and eulerAngles, I do enjoy this kind of problem, perhaps the issue is multiplied by a fractional amount based on position of camera

I added a textdisplay, filled in Update by fpsCam.transform.localEulerAngles. I changed the Debug-output to fpsCam.transform.eulerAngles instead of fpsCam.transform.localEulerAngles - the result is the same as before.