Mouse input stutters after touching hierarchy/inspector

EDIT: This actually seems related to the editor/inspector, as the stutter mostly depends on what is currently selected in the hierarchy regardless of cinemachine. I guess I didn’t test thoroughly enough

I got a weird bug that makes the mouse input stutter when I touch something in the hierarchy or change a value in the inspector while the game is playing.

I believe this is related to cinemachine because deleting the virtual camera and instead making the main camera a child of PlayerCameraRoot instead does not result in the stuttering behavior. This is shown in the video when the game is played the second time at 0:52.

Demonstration:

Replication:

  • Create a new 3D project, 2020.3 or higher like the starter asset description says (2020.3.15f2 in this case, but I’ve tried others as well with the same stuttering)
  • Import ‘Starter Assets - First Person Character Controller’ 1.0 from the package manager (or the third person character controller, stutter still occurs)
  • Choose yes to the dialogue asking to change to Input System and it will restart the editor
  • Open and play the Playground scene, the mouse input should be smooth
  • Click on stuff in the hierarchy/inspector, mouse input should stutter at this point

Notes:

  • Opening another scene resets the smoothness, but clicking in the hierarchy/inspector brings the stutter back

  • Oddly enough gamepad input remains smooth even when the mouse input stutters.

  • I have tried similar setups using cinemachine independent of the starter assets and the stutter occurs there as well, with the same camera ‘fix’ removing the stutter

  • I have tried this on two additional computers with the same results

It’s a known Unity Inspector issue. The culprit is the “Transform” section. If you collapse it, the stutter disappears.

I think I was experiencing two different stutter issues simultaneously which is what made this so frustrating. I had heard about the transform section issue but it didn’t seem to make the problem go away (in actuality it made one problem go away).

It turns out that similar to the transform section issue, having some scripts expanded in the inspector (i.e. StarterAssetsInputs) also cause stutter. Not sure if it’s unique to the starter assets or what’s going on there.

The gamepad thing also made me think there was only one issue because it actually made input smooth for both issues.

Currently my ‘fix’ is to just click on the scene root when I’m not changing or monitoring any values because there is absolutely nothing in the inspector there.

Thanks for the help I wouldn’t have double checked the transform issue otherwise

1 Like