So I’m switching my TPS game project over to the cinemachine system and experimenting with using the state driven camera with different free look cams. The issue is that I think they need to be set to worldspace orbits to work with my setup (I’m rotating the character with the camera), and with worldspace orbits the camera resets its rotation on transition to a new state.
Is there a way to get around this without code? Or if custom scripting is necessary where’s a good place to start?
Are you using the latest CM from package manager? You should be.
The code there transfers the axis values on transition between FreeLooks with the same Follow target.
Also be sure in your use-case to check the “Inherit Position” checkbox:

1 Like
I’m using the latest download from the package manager.
I thought that checking that might fix the issue but I have them checked on all my free look cameras and it hasn’t fixed it. The only way I’ve got it to stop is by switching all my cameras’ orbits binding from “worldspace” to “Simple follow with world up”, but this causes problems with character control.
Then I don’t understand what’s happening. The code in FreeLook does this:
public override void OnTransitionFromCamera(
ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime)
{
base.OnTransitionFromCamera(fromCam, worldUp, deltaTime);
bool forceUpdate = false;
if (fromCam != null)
{
CinemachineFreeLook freeLookFrom = fromCam as CinemachineFreeLook;
if (freeLookFrom != null && freeLookFrom.Follow == Follow)
{
if (m_BindingMode != CinemachineTransposer.BindingMode.SimpleFollowWithWorldUp)
m_XAxis.Value = freeLookFrom.m_XAxis.Value;
m_YAxis.Value = freeLookFrom.m_YAxis.Value;
forceUpdate = true;
}
}
Maybe there’s something weird in your controller?
Or maybe the Follow targets aren’t the same?
Can you upload a little package that shows the problem?
https://drive.google.com/file/d/1jVqCauFST6UfJ5JHah7Plx4oFB5kAeO1/view?usp=sharing
Here’s a package that shows the problem on an animated character with no controller.
Thanks. Using CM 2.2.7 I see no problems at all on transitions. It’s perfect. What version of CM are you using?
I’m using CM 2.2.0. Sorry, I thought that was the most up to date version.
How do I get CM 2.2.7?
Just open the package manager, it should prompt you to upgrade
Do I need a newer version of Unity? I’ve got 2018.2.2 and the package manager says I’m up do date.
Merde! So that means 2.2.7 is still in staging, not published yet. You can access it by following the instructions here: Cinemachine FixedUpdate not syncing with fixedupdate movement? (2.2.0)
That fixed it! Thank you so much for helping me out!