Virtual-Joystick-Godot icon indicating copy to clipboard operation
Virtual-Joystick-Godot copied to clipboard

Deadzone not respected when using input actions

Open olanti-p opened this issue 1 week ago • 0 comments

Hello.

I've tried using the joystick in one of my projects, and run into an issue where the deadzone is not respected when using input actions.

For instance, simply touching the joystick and not moving your finger is enough to trigger "left" action. If finger moves past the right deadzone boundary, the joystick immediately switches to the "right" action, so effectively there is no deadzone at all.

I think I've tracked it down to this code snippet:

https://github.com/MarcoFazioRandom/Virtual-Joystick-Godot/blob/49963c98299995745170353b9424bf0771653115/addons/virtual_joystick/virtual_joystick.gd#L136-L156

Apparently while finger stays in the deadzone, output.x equals 0, so when output.x > 0 condition is evaluated, the false branch is taken, and the "left" action is emitted. Expected behavior in this case would be to not emit either "left" or "right" actions at all. Similar issue with Y axis.

Cheers.

olanti-p avatar Jun 26 '24 19:06 olanti-p