# Cinemachine and InputSystem mouse jitter

**URL:** https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094
**Category:** Cinemachine
**Created:** [April 3, 2022, 5:35pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094 "2022-04-03T17:35:15Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![dkamp](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dkamp](https://discussions.unity.com/u/dkamp)
#### Post date: [April 3, 2022, 5:35pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/1 "2022-04-03T17:35:15Z")

</div>

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:

 ![8017646--1032272--Screenshot 2022-04-03 190218.png](https://europe1.discourse-cdn.com/unity/original/4X/4/3/6/43670b95ceead7a60b21660cbfcd082485d3e6be.png)

I have ensured the Input happens in Dynamic update:

 ![8017646--1032269--Screenshot 2022-04-03 190236.png](https://europe1.discourse-cdn.com/unity/original/4X/8/e/9/8e9750215875ecbf99d6e01837151768165ca963.png)

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

```csharp
    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](https://easyupload.io/yl0wxx)): 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

---

<div class="post-metadata">

### Author: ![gaborkb](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/gaborkb/32/409856_2.png) [@gaborkb](https://discussions.unity.com/u/gaborkb)
#### Post date: [April 4, 2022, 1:27am UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/2 "2022-04-04T01:27:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dkamp](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dkamp](https://discussions.unity.com/u/dkamp)
#### Post date: [April 4, 2022, 2:12pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/3 "2022-04-04T14:12:39Z")

</div>

> [@gaborkb](#):
>
> Could you show your vcam, and the full script where you have CameraRotation?

Sure, attached the Script and here is the screenshot of my Camera/Vcam/Script\* setup: ![8019479--1032698--Screenshot 2022-04-04 143533.jpg](https://europe1.discourse-cdn.com/unity/original/4X/1/9/b/19b3d242b3da9acc7aad21fc02555675ac27a603.jpeg)

\*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](https://discussions.unity.com/uploads/short-url/A1NwtacX7vkRW9v0Bj7nhFQmiXp.cs) (4.5 KB)

---

<div class="post-metadata">

### Author: ![gaborkb](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/gaborkb/32/409856_2.png) [@gaborkb](https://discussions.unity.com/u/gaborkb)
#### Post date: [April 4, 2022, 2:42pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/4 "2022-04-04T14:42:59Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dkamp](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dkamp](https://discussions.unity.com/u/dkamp)
#### Post date: [April 4, 2022, 2:50pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/5 "2022-04-04T14:50:47Z")

</div>

> [@gaborkb](#):
>
> Could you show me your vcam (FreeLookVirtualCamera) and CinemachineBrain on Main Camera?

So sorry brain spasm…:

![8019593--1032716--Screenshot 2022-04-04 165021.png](https://europe1.discourse-cdn.com/unity/original/4X/6/3/a/63a685cfa958d2bc199f8e748a9224e700b79544.png) ![8019593--1032719--Screenshot 2022-04-04 165006.png](https://europe1.discourse-cdn.com/unity/original/4X/f/5/c/f5c3558a498322f37a4721d259477d58fa1a396d.png)

**EDIT**  
Expanded VCam settings:  
 ![8019593--1032731--Screenshot 2022-04-04 165857.png](https://europe1.discourse-cdn.com/unity/original/4X/a/d/c/adc8f3383b9113d935c4b2efaec417d1beba88e4.png)

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

---

<div class="post-metadata">

### Author: ![dkamp](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dkamp](https://discussions.unity.com/u/dkamp)
#### Post date: [April 6, 2022, 4:50pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/6 "2022-04-06T16:50:46Z")

</div>

> [@gaborkb](#):
>
> Could you show me your vcam (FreeLookVirtualCamera) and CinemachineBrain on Main Camera?

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

---

<div class="post-metadata">

### Author: ![gaborkb](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/gaborkb/32/409856_2.png) [@gaborkb](https://discussions.unity.com/u/gaborkb)
#### Post date: [April 6, 2022, 10:03pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/7 "2022-04-06T22:03:48Z")

</div>

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](https://unity3d.com/unity/beta/guide-to-beta-testing#tab-3)**).

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.

---

<div class="post-metadata">

### Author: ![dkamp](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dkamp](https://discussions.unity.com/u/dkamp)
#### Post date: [April 7, 2022, 10:51am UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/8 "2022-04-07T10:51:02Z")

</div>

> [@gaborkb](#):
>
> 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](https://unity3d.com/unity/beta/guide-to-beta-testing#tab-3)**).
> 
> 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!

---

<div class="post-metadata">

### Author: ![bobyer\_fallen](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@bobyer\_fallen](https://discussions.unity.com/u/bobyer_fallen)
#### Post date: [November 19, 2022, 2:19am UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/9 "2022-11-19T02:19:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![gaborkb](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/gaborkb/32/409856_2.png) [@gaborkb](https://discussions.unity.com/u/gaborkb)
#### Post date: [November 19, 2022, 2:38pm UTC](https://discussions.unity.com/t/cinemachine-and-inputsystem-mouse-jitter/877094/10 "2022-11-19T14:38:11Z")

</div>

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?
