How to make Free Look camera stop tracking Mouse movements when holding button.

I want my free look camera to stop rotating when Im holding shift, but still follow the player.
Then go back to a Free look camera when I let go of shift.

I tried doing some shenanigans with switching between seperate cameras, but I couldn’t get the correct results.

Shenanigans with switching between separate cameras is probably the right approach. You just need the right shenanigans. What did you try and how was it wrong?

I had my free look camera, and a normal virtual camera which I set the position to the freelook camera every frame. It almost worked but the camera would either reset back to its original position when I switched, or it would fly off into the distance for whatever reason. The best I got was where it would track the player, but not follow. which is the opposite of what I want. It just felt like there was 1 setting I was missing.

Can you show me the inspectors for the FreeLook and the other vcam? You can paste images directly into the forum post.

The freelook
6446569--721651--upload_2020-10-22_13-21-7.png6446569--721654--upload_2020-10-22_13-21-27.png6446569--721657--upload_2020-10-22_13-21-43.png
The vcam
6446569--721660--upload_2020-10-22_13-22-44.png

6446569--721660--upload_2020-10-22_13-22-44.png

Try enabling this in both cameras:

6446593--721666--upload_2020-10-22_14-25-28.png

It almost worked! but now the vcam is slowly spinning until it spirals out of control

I got it working thanks for the help = )

1 Like

This worked ok for me…

void Update()
{
if (Input.GetKeyDown(KeyCode.LeftControl ) )
{
vcam.m_XAxis.m_InputAxisName = “Mouse X”;
vcam.m_YAxis.m_InputAxisName = “Mouse Y”;
}
else if (Input.GetKeyUp(KeyCode.LeftControl))
{
vcam.m_XAxis.m_InputAxisName = string.Empty;
vcam.m_YAxis.m_InputAxisName = string.Empty;
}
}