I’m developing a fighting game and having some trouble with consistency of input speed at different framerates, especially tracking the left thumbstick. What I’m doing instead of using functions bound to an axis (which is tied to framerate), is I’m setting a looping timer every 15ms or so and reading the thumbstick with InputComponent->GetAxisValue() and storing the presses in an array (in a d-pad 8-way fashion) as soon as I poll them, all in my PlayerController class.
At 60fps+, if I spin the thumbstick as fast as I can, i get all my inputs correctly, but as the framerate goes down (I tested with t.maxfps and with post processing oversampling for a “genuine” cap), I start missing entries.
Then I noticed that when the frametime dropped below my timer’s period, the timer just started firing slower, at exactly the frametime. Also I suspect that the engine is updating the axis values slower as well. Since this is a fighting game, I need the input polling rate to be consistent. Locking my framerate to 60fps is not an option unfortunately. Can someone guide me to a way to read the input in realtime?
Thanks in advance.