Cinemachine Input Provider not working?

Using Cinemachine 2.8.1
Using Input System 1.1.1
Using HDRP 12.0.0

I have the New Input System selected in preferences.

These are my settings:

I have also tried Passthrough instead of value, I ramped up the speed in case that was the issue but it doesn’t seem to be.

The following code is in Awake:
7599238--942976--upload_2021-10-25_1-19-21.png

Which links to this:
7599238--942979--upload_2021-10-25_1-20-7.png

Using this it clearly reads the Input value just fine
7599238--942973--upload_2021-10-25_1-18-46.png

Curiously yesterday this was actually working fine using Value, today it doesn’t seem to work at all…

Does anyone have any insight as to why?

It is very difficult to say. On my side, the input works.
Did something change since yesterday when it was working?

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.

1 Like

Curiously I upgraded the engine version as tomwilhelm posted above, that’s the only difference as far as I know

I could not reproduce the issue with this setup:
Unity version 2021.2.0f1
Using Cinemachine 2.8.1
Using Input System 1.1.1
Using HDRP 12.0.0

Could you submit a bug report with a repro project please?

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.

7627477--949021--input_cinemachine.png

Edit: Using:

  • Editor 2021.2.0
  • Input 1.1.1
  • Cinemachine 2.8.2
2 Likes

Could you submit a bug report with a repro project or send me a direct message with your project please?

Hi I’ve spent the morning trying to reproduce with a new project but can’t.

Perhaps an upgrade from an old project to 2021.2.f1 might cause it?

I’m going to try and reimplement the PlayerInput again and see what happens.

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.

[SerializeField] private CinemachineBrain cinemachineBrain;

public void LateUpdate()
    {
        DoAnyVCamUpdates();

        cinemachineBrain.ManualUpdate();
   }

Interestingly, even doing this in the LateUpdate method didn’t work

AxisState.IInputAxisProvider inputAxisProvider = cinemachineFreeLook.GetInputAxisProvider();
AxisState m_XAxis = cinemachineFreeLook.m_XAxis;
m_XAxis.m_InputAxisValue = inputAxisProvider.GetAxisValue(0);

We could reproduce the issue, and are investigating with the Input System team.

A temporary fix, this should not be necessary, when the issue is fixed:

Your input might not be working, because it is not processed in the same update loop as CinemachineBrain’s Update method.

In Edit > Project Settings > Input System Package, change the Update method.

Check, which Update Method CinemachineBrain is using, and set the input to the same.

  • If CinemachineBrain is in Late Update, then set Dynamic Update for inputs.
  • If CinemachineBrain is in Fixed Update, then set Fixed Update for inputs.

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.
1 Like

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.

1 Like

This appears to have been fixed by upgrading Unity’s InputSystem to v1.2

4 Likes

I have the same question. It seems that this problem is still not fixed…

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,

The input actions are not enabled by default. You have to enable them.
What version of Cinemachine are you using?

Unity Version: 2021.2.17f1
Cinemachine: 2.8.4
Input System: 1.3.0

1 Like

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?

Using:

  • Unity 2022.1.0b14.2951
  • Cinemachine 2.8.4
  • Input System 1.3.0

My Settings:


Input System’s Update Mode is set to “Process Events in Dynamic Update”

In the virtual camera’s Body section, change Transposer to Orbital Transposer. The plain Transposer doesn’t take user input.