Cinemachine Freelook instant rotation

Hello!
I am trying to do an instant rotation on a CinemachineFreeLook rig. This is so that I can achieve a “hard cut” where the camera is rotated to a new angle.

The x axis seems to respond immediately, but setting the Y axis (which prefer a value between 0-1) seems to take one or more frames to procedurally find its pitch position.

// This seem to work immediately
AnchorCamera.GetComponent<CinemachineFreeLook>().m_XAxis.Value = Vector3.SignedAngle(Vector3.forward, forward, Vector3.up);

// This will take effect one frame later
AnchorCamera.GetComponent<CinemachineFreeLook>().m_YAxis.Value = .5f;

Looking at the code, the method ForceCameraPosition(position, rotation); could be useful here, but that leaves me having to calculate the end position in the freelook orbit first.

Is there a way for me to have the procedural Y orbital position to be calculated immediately?
Or similarly, is there a way to get a suggested orbital position that can be used in conjunction with ForceCameraPosition?

I could also add to this that I do not use any damping on Aim and Body

Try setting freeLook.PreviousStateIsValid=false. Then you can keep the damping.
EDIT: oh, sorry. Misread your previous post. Try adding that anyway and tell me if it helps.

Thanks Gregory for the quick reply. Unfortunately this didn’t fix it. Had to do some recordings and study frame by frame. The new Y axis still is delayed by at least one frame.

I don’t understand why you have the delay. I’d have to look into the code, which I’m not free to do right now. As a quickie experiment, try calling freeLook.InternalUpdateState() after you set the axis values. Maybe that will do it.

Calling freelook.InternalUpdateCameraState(Vector3.up, -1); seem to have solve it!
Note that it did not work when sending deltaTime with a value higher than 0. I am curious to why this happens?

1 Like

deltaTime = -1 implies a PreviousState reset, eliminating damping.