Issue after updating from CM 2.6.17

Hi,

I’ve got a bit of a strange issue that I’m not sure how to fix really, or what has changed to make this happen. So I’ve updated my game that was using CM 2.6.17 to now using CM 2.9.7, but in doing this, it has changed the behaviour of my virtual camera.

When the Virtual Camera becomes “live”, the rotation of that camera changes completely and throws off where it should be looking. This happens even in the Editor.

Set correctly:

9578188--1355905--upload_2024-1-12_19-7-26.png.

Set the priority of the camera to it becomes live:

9578188--1355908--upload_2024-1-12_19-8-12.png

Rotation is changed from 90 to 76.

This doesn’t happen on the older version in 2.6.17

Here are the settings of my VM:

Something else I noticed, is that some of the properties are no longer visible, unless you set Solo when these appear:

Not sure if this is part of the problem?

Not really any idea how to fix it, except to roll back, which I can do - just usually keep things up to date

Offhand I can’t tell you what’s happening. For sure the inspectors look strange, and that’s puzzling.

9583492--1357204--upload_2024-1-15_17-35-14.png

If you re-import the project, is the problem still there?
What does the TargetGroup inspector look like, when the camera goes wrong?

Hi, sorry for the delay.

I’ve tried a re-import and get the same result when the camera becomes active, it shifts the rotation. And all the variables have the M_{Name} still.

The target group in Edit mode is like this:

9591958--1359313--upload_2024-1-19_13-22-32.png

As the game is played, more items are added to the board to frame the camera on all the items.

What is controlling the rotation of the GameCamera object? You are adding a tilt with the CinemachineRecomposer. As an experiment, remove that behaviour. What happens to the camera rotation? Do you have any other behaviours on that GameObject, and do any other scripts attempt to set its rotation?

Would you be willing to send me the project?

There shouldn’t be anything rotating the GameCamera - thats kinda the issue. Before we used the recomposer, the camera would move in and out of the board as well, which isn’t what we wanted - so the GameCamera was set a top down view, the TargetGroup would update the position, and the the tilt from the recomposer would give the correct framing angle we wanted to achieve

In the older version of Cinemachine, this works correctly - the camera is set to 90 all the time and it adjusts the postion framing from targetgroup with the tilt applied afterwards. With the latest version, rotation is applied to the GameCamera, which throws everything off.

Not sure if this is the correct and intended use now and something that has been “fixed”, and our use should never have worked.

Not able to share the project unfortunately.

Instead of starting with the camera to 90 degrees, start with it at 80 or something like that. I’m thinking it might have something to do with gimbal lock. What happens when you try that?

ok - so yeah, trying that does the same thing. no composer on - activate the camera with priority and it gets rotated - even though nothing should be adjusting the rotation

So it comes down to figuring out where the rotation is coming from. There is nothing in the vcam with FramingTransposer and CameraOffset that will rotate the camera - it will simple use the rotation in the transform as-is. So the rotation is coming from somewhere else.

Do you have any scripts that reference the camera?
Do you have any custom behaviours on the camera?
Is the camera’s parent being rotated?

Yeah - that is what I assumed would be the case too - and that is what is confusing about it, as it also does it when not in play mode. All I have to do is set that priority up high so its the active camera on the brain, and GameCamera rotates. So, while there are code references to it - though nothing changes its position - these aren’t running at that point.

For a while, I thought it was something I must be doing in code, but nothing ever touches the GameCamera’s transform. Only the TargetGroup affects it, and its set to position only, not rotation. But then when I was able to replicate it just turning the camera on in Editor, it seemed something different.

edit - the GameCamera does have a parent

What do you mean, the target group affects it. How? The target group is a separate game object, is it not? How does it affect the camera’s rotation?

Sorry, the target group is the only thing that has any interaction with the GameCamera’s transform. I don’t adjust it in code at all. It is on a separate component yes.

My set up is like so.
9592321--1359391--upload_2024-1-19_16-4-21.png

GameCamera is following the targetgroup

9592321--1359397--upload_2024-1-19_16-5-29.png

ok, so when the Recomposer is disabled, nothing in CM is touching the vcam’s rotation. It should remain constant at whatever you set it to, whether it’s the active vcam or not.

Too bad you can’t send me the project. You need to find out by elimination what’s going on.