I’m trying to get my game to run on both low end and high end computers. I’ve been testing it on a very low end laptop where I average about 20 fps with high graphics settings.
The issue is there is about a 4 frame lag in Unity between when you press a button and it’s updated. I tested this with a single scene consisting of some spheres and a camera with processor filter that I know eats up resources.
I attached one script. Each time you press a button the spheres scales and the frame rate drops as expected.
The problem comes in when you get below 40 fps the input lag becomes noticeable. At around 20 fps there is about a 1/4 second or more delay.
Is there a better way to get instant input ?
Also has anyone else reported this to Unity ? It’s definitely a problem with the internal processing system. This amount of input lag is unacceptable.
Yeah input is frame bound.
There’s a new input system coming in the 2017 dev cycle that might address these things. I think 2017.2 has a preview of it.
Another thing to do at low frame rates is to turn off the default input filtering. Use Input.GetAxisRaw() instead and do your own filtering, if you still need it. It’s a quick thing to check though: swap it out, give it a try, revert if it doesn’t work. (You ARE using source control, right??)
That’s bizarre, honestly. It’s normal for 1 frame lag, maybe 2 frames if you’re doing stuff between Update/LateUpdate in a weird order, or basing your movement on physics (which may need a whole Update->FixedUpdate->Update->Render cycle to register a key press visually). Post your code, and we might be able to find something weird that would be adding frames to your delay.
Also @Kurt-Dekker 's advice about GetAxisRaw is a good first place to check.