Hello,
I would like to have some help regarding my issue. Might be hard to find out from a forum post, but I would like just an idea of where it could come from.
I have a Orbit Camera (Cinemachine Free Look) that switch to another Aim Camera (Cinemachine Virtual Camera) when the player AIM.
When in Orbit camera, the player movement are relative to the camera orientation, and when switching to AIM, the camera movement do not affect the player movement, and the player will always look forward.
public void SwitchToFreeLook()
{
_isAimMode = false;
aimCinemachine.SetActive(false);
freeLookCinemachine.SetActive(true);
if (_animator)
{
_animator.SetBool("IsAiming", false);
}
}
public void SwitchToAim()
{
_isAimMode = true;
freeLookCinemachine.SetActive(false);
aimCinemachine.SetActive(true);
// I tried also this instead
//freeLookCinemachine.Priority = 0;
//aimCinemachine.Priority = 1;
// player will face like camera
transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, brainCamera.transform.rotation.eulerAngles.y, transform.rotation.eulerAngles.z);
if (_animator)
{
_animator.SetBool("IsAiming", true);
}
}
I am currently doing the above code to switch from one camera to the other.
When I transition from the FreeLook to the AIM camera, all work fine, but when coming back to FreeLook, the camera do some weird rotation and I don’t understand exactly from where does it come from. Note that with I thought it was the camera repositioning after being set Disabled, but even with priority it does the exact same thing. There is no auto recentering setup, but even with, there is the same thing.
cheapimpressivecoelacanth
EDIT :
I slow down a video I took, and it looks like that the camera start to rotate with the 3rd camera when releasing the AIM, and blend back to the free camera.
Is there a way to blend from A start point to B end point without caring about the movement of A after the blend started ?
formaldeliriousbasil