Cinemachine and InputSystem mouse jitter

Hi there,

I’ve had this problem for a while, and nothing I’ve read or done has resolved it. I am unsure if its a Cinemachine or new InputSystem issue.

I’m using Unity 2022.1.0b14, Cinemachine 2.8.4 and InputSystem 1.3.0 (I don’t think any of this matters as I’ve been updating through the various versions but it always persists). My frame rate never drops below 100 so I cant believe its got anything to do with that especially as when I use the gamepad its pretty much butter smooth.

I have my InputSystem “Move” defined as the Starter Asset - Third Person Controllers is:

I have ensured the Input happens in Dynamic update:

I have also made sure I rotate the Cinemachine target in LateUpdate:

    public void LateUpdate()
    {
        CameraRotation();
    }

    //....

    private void CameraRotation()
    {
        // if there is an input and camera position is not fixed
        if (_look.sqrMagnitude >= _threshold)
        {
            // suggested here https://discussions.unity.com/t/844104 page-6#post-7946512
            float deltaTimeMultiplier = _playerInput.IsKeyboardAndMouse() ? 1f : Time.deltaTime;
            var sensitivity = _slowDown ? FocusSensitivity : 1f;
            _cinemachineTargetYaw += _look.x * deltaTimeMultiplier * sensitivity;
            _cinemachineTargetPitch += _look.y * deltaTimeMultiplier * sensitivity;
        }

        // clamp our rotations so our values are limited 360 degrees
        _cinemachineTargetYaw = ClampAngle(_cinemachineTargetYaw, float.MinValue, float.MaxValue);
        _cinemachineTargetPitch = ClampAngle(_cinemachineTargetPitch, BottomClamp, TopClamp);

        // Cinemachine will follow this target
        _transform.rotation = Quaternion.Euler(_cinemachineTargetPitch, _cinemachineTargetYaw, 0.0f);
    }

However as you will hopefully see in the below video (SPOILER it doesnt show in the linked video, so here here is the file to download in full quality Upload Files | Free File Upload and Transfer Up To 20 GB): The first 13 seconds I use the mouse to pan left and right, and there is this annoying jitter. After 13 seconds I switch to my gamepad/xbox controller and you can see there is significantly less noise in the panning, after the 23 seconds mark, I switch back to mouse and it becomes pretty obvious I am using the mouse to pan as the jitter is back.

infamousidolizedblacknorwegianelkhound

I have no idea why this is happening and it really gives me a bad feel of the game and very disheartened, Cinemachine makes life easy so if I need to use the old way I would hate it, the same for the new InputSystem, I hope its something I’m missing

Could you show your vcam, and the full script where you have CameraRotation?

1 Like

Sure, attached the Script and here is the screenshot of my Camera/Vcam/Script* setup:8019479--1032698--Screenshot 2022-04-04 143533.jpg

*Script isnt perfect if I use gamepad and put the left stick in South Easterly direction, I seem to move faster lol and maybe other bugs

8019479–1032692–FreeLookCamera.cs (4.5 KB)

Could you show me your vcam (FreeLookVirtualCamera) and CinemachineBrain on Main Camera?

So sorry brain spasm…:

8019593--1032716--Screenshot 2022-04-04 165021.png 8019593--1032719--Screenshot 2022-04-04 165006.png

EDIT
Expanded VCam settings:
8019593--1032731--Screenshot 2022-04-04 165857.png

NB: Line 107 of the script should be _transform.position += ... (added underscore)

Any update on this? Or at least if you can replicate it or not?

Could you send me your project? You can either send me a direct message here or submit it as a bug report (How to report bugs).

There were a couple of issues with how Cinemachine handled the new input system. We have fixed them, but it is not yet released. I’d like to check if those fixes fix your issue or not.

Thanks very much! Just PM’d you now!

are there any updates? i’m facing the same issue, however it happens for me with any cinemachine so: framing transposer + fov
or thirdperson with rotate like above,
but also the freelook has problems
unity 2021.3.11

The repro project dkamp sent me was fixed by upgrading cm on my side to the latest version.

If you experience the problem on latest CM, could you submit a bug report or send me a repro project please?