I’m having a similar issue. I noticed this when I updated my project from Unity 2021.1.25 to 2021.2.0. CinemachineInputProvider seems to track the values correctly until I press a button associated with a different input action. I am also using a PlayerInput component which might be related.
I’m getting exactly the same problem - the only thing that fixed it in the Play Mode Editor, was to change the Update Mode in the Input System settings to “Process Events in Fixed Update”. Unfortunately once I build the project the camera then is jerky when rotating freelook or zooming. I’ve tried a few settings in the CinemachineBrain to try and fix it, but to no avail.
Ok so the best I can do is share these logs with you.
I have added the following debug statements in LateUpdate in a Script on my CinemachineFreeLookCamera
public void LateUpdate()
{
Debug.Log($"YAxis Value {cinemachineFreeLook.GetInputAxisProvider().GetAxisValue(1)} " +
$"YAxis InputValue {cinemachineFreeLook.m_YAxis.m_InputAxisValue}");
}
The logs before I press a button associate with another action event are as follows:
“YAxis Value 1 YAxis InputValue 0”
“YAxis Value 3 YAxis InputValue 1”
“YAxis Value 1 YAxis InputValue 3”
“YAxis Value 3 YAxis InputValue 1”
and so on…
The logs after I press a button associate with another action event are as follows:
“YAxis Value 3 YAxis InputValue 0”
“YAxis Value 2 YAxis InputValue 0”
"YAxis Value 1 YAxis InputValue 0
As you can see the “cinemachineFreeLook.GetInputAxisProvider().GetAxisValue(1)” call is returning the correct value, but after I press a key associated with another input action “cinemachineFreeLook.m_YAxis.m_InputAxisValue” is always 0.
So I have found a temporary fix - I set the CinemachineBrain’s update method to “Manual” and then called Cinemachine.ManualUpdate() in the LateUpdate method of a script attached to the freelook virtual camera.
Here is a summary of what each update mode means in CinemachineBrain:
FixedUpdate: Virtual cameras are updated in sync with the Physics module.
Use FixedUpdate if all your targets are animated with for RigidBody animation
LateUpdate: Virtual cameras are updated in MonoBehaviour LateUpdate.
SmartUpdate: Virtual cameras are updated according to how the target is updated.
ManualUpdate: Virtual cameras are not automatically updated, client must explicitly call.
Thanks @gaborkb Good to hear you have reproduced it.
I have tried both the Late Update and Dynamic Update settings you suggested and they both work, however they don’t produce as smooth freelook camera as having Input Settings set to “Process Events in Dynamic Update” and CinemachineBrain’s update method set to “Smart Update”.
In the meantime I have just implemented some editor directives as this doesn’t seem to happen when I build the project.
Is it possible that you have multiple action maps in play? By default, CinemachineInputProvider is set up to map to the DefaultInputActions asset that ships with the input system. If you’re using a different input map, you should make sure that you set CinemachineInputProvider up with the correct actions.
Hello, I got the same problem.
Acording the tutorial video I make the new Input System with Cinemachine. Simply I just create a CinemachineFreeLook camera and set it Follow and LookAt to target. And plus Cinemachine Input Provider with the InputAction that I created.
When I click the ‘Play’ button on the top of Unity, the FreeLook Camera doesn’t work.
These are the screenshots for my project:
[Cinemachine FreeLook Camera]
[It is the InputAction object I created]
Could anybody please help me to figure out where I do the mistake settings on my project.
Sincerely,
I have a related issue where the Cinemachine Input Provider on my Cinemachine Virtual Camera is giving proper gamepad input values (via GetInputAxisProvider() and GetAxisValue()) but the camera itself isn’t moving or orbiting around.
It works fine if I use a different type of Cinemachine camera (or I believe with certain different Virtual Camera settings), but I got the proper setup and control just the way I like it with an ordinary Cinemachine Virtual Camera which I failed to achieve with the other built-in camera types.
All I need is for the virtual camera to now respond to input, orbiting around the Follow Target when the player uses the Right Analog Stick. Would I need to subclass CinemachineVirtualCameraBase or something and perform the XY movement manually?