Unity input stutter with new Input System and 3rd Person Starter Asset
I'm using the 3rd person starter asset with the new Input System and after adding a new InputAction
on the player so I could handle item interactions, the camera movement in playmode became unbearably choppy (think, like 2 fps); however the problem isn't framerate. I have 200+ fps and everything in the scene moves smoothly except for the camera. Even testing the camera with a simple rotate 5 degrees/second script runs smoothly. The problem seems to be the input system being choppy. This choppiness persists into the build, so it has to be some static asset, not just editor problems.
I tried removing the code that preceded the behavior, but the choppiness persisted.
I then created a new project to test out slowly adding features until something broke, but in the process of doing so, that fixed the stuttering on the main project (I did a lot of things here so IDK what exactly fixed it). I was even able to add the InputActions
back in with no problems. But then I modified the ThirdPersonController
(I added a boolean to control whether it should move or not; unrelated to camera movement) and the problem came back.
Anyway, if anyone has an a known method for fixing this problem, it would be appreciated.
EDIT:
I have determined that this is a problem exclusively with the mouse input not gamepad input, so this is definitely a problem with the input system, not anything higher level.
I am also having this issue! A lot of people said it is fixed with changing it to Dynamic update but that has not resolved the issue for me
Answer by johncrockett15 · Feb 03 at 05:46 PM
Project Settings > Input System Package > Update Mode; Make sure it's set to "Process Events in Dynamic Update."
You're very much correct that it's not a frame rate issue. What's happening is that the 3rd Person Starter Asset uses the Mouse Delta action, and If it's set to fixed update, the input state on the mouse delta action will frequently return "canceled" during continuous movement (as of newer versions of LTS unity), causing the delta to return 0, causing the illusion of "stuttering."
Oh my god. thank you. This problem was bothering me since months and I looked through all the code and stuff and was going insane. This was the exact problem. THANK YOU
Answer by JoernSchoenyan · Jan 03 at 08:53 AM
I'm having this problem, too!
Found a possible solution: in the settings of the Input System Package, set Update mode to "Process Events in Dynamic update" instead of fixed update.
Johncrockett15, YOU ARE AMAZING!!! Thank you so much. I had this same issue for two days and I wanted to make sure I logged in to post this comment to let everyone know that this solved the issue. So many forums had many other suggestions, but this by far fixed everything.