Obscure latency with InputAction's canceled event
Hey there,
I have a problem with player movement at low frame rate in a 2D side-scroller game. I use the InputSystem with a configured Move action. My player movement script registers with the started, performed and canceled events.
Symptoms:
When I press 'D' (for instance) the player starts moving as intended. The thing is, when 'D' is released, the player does not always stop immediately. This starts happening at a frame rate of somewhat below 30 and gets more severe with decreasing FPS. It can take up to a few seconds until the player stops.
There also is a Sprint action which is equally affected. When sprinting (pressing 'Shift' and 'D'), I observe the following: When I release 'Shift' x time before I release 'D', the character keeps running for a while, then goes on walking until he eventually stops after (again) x time. (I did not measure this, but it looks like it.)
It seems like the InputSystem is not registering the change in time. Adding
Debug.Log
instructions to the event callbacks shows that the canceled event triggers with the observed delay. PollinginputAction.ReadValue<>()
in anUpdate
method does not make a difference. The returned value is outdated as well.
We are currently on Unity version 2019.3.15f1 and InputSystem 1.0.0.
Any ideas are highly appreciated.
Your answer
Follow this Question
Related Questions
Input Button Fire 1 is not setup 0 Answers
Cannot get InControl to work 0 Answers
Change Input.GetKey to Input.GetAxis 1 Answer
Blender Inputs to Unity Inputs 1 Answer
I'm having trouble rotating a game object by dragging screen using touch input 0 Answers