Home > OS >  How to stop cinemachine freelook camera rotation
How to stop cinemachine freelook camera rotation

Time:06-28

I am working on a third person parkour game with new input system and cinemachine(Freelook). You move with the right joystick and look around using right joystick(Cinemachine Input provider). For doing tricks I am using button with one modifier, you press R2 and move the right joystick in different directions for different tricks. But when I move the right joystick for a trick cinemachine rotates the camera.

Is a way to stop cinemachine from rotating the camera when other buttons are pressed.

Thank you in advance, Hemanth

CodePudding user response:

You can simply disable the component.

public CinemachineFreeLook freeLook;

private void Lock() => freeLook.enabled = false;

Another way is to set the Mouse Axis Speed to zero. In this method, with the help of a tweener, you can gently disable the movement of the mouse.

private void Lock()
{
    DOVirtual.Float(freeLook.m_XAxis.m_MaxSpeed, 0f, 1f, value => freeLook.m_XAxis.m_MaxSpeed = value);
    DOVirtual.Float(freeLook.m_YAxis.m_MaxSpeed, 0f, 1f, value => freeLook.m_YAxis.m_MaxSpeed = value);
}

CodePudding user response:

you can probably remove the component that will probably help

  • Related