Here is a quick way to reset the previous position and rotation of your FreeLook camera once you enter TargetingCamera. Here’s how it looks
In your FreeLookCamera settings, you will need to change theses
We need a reference to our FreeLookCamera in PlayerStateMachine.cs like this (drag your freelook camera in the inspector to link it)
[field:SerializeField] public CinemachineFreeLook FreeLookCamera { get; private set; }
Then all we need to do is enable the Recentering when we enter the Targeting state (Enter Function) like this
stateMachine.FreeLookCamera.m_RecenterToTargetHeading.m_enabled = true;
And Disable the Recentering when we enter the FreeLook state like this
stateMachine.FreeLookCamera.m_RecenterToTargetHeading.m_enabled = false;
Don’t forget to add using Cinemachine;
in all 3 places.