InputMap action auto-releasing with Joystick axis input.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Strelly

Hello, I hope you are all having a nice day.

I’m using the InputMap as the input manager for my game, right now I have left, right, up and down, assigned to both “WASD” and the left joystick of my controller.

I use Input.is_action_pressed("rightAction") to check if the action is pressed.

When I don’t have a controller connected, “WASD” works fine, returning true every frame. However, when I connect my controller, using the joystick itself works fine, returning true as well, but trying to use “WASD” while the controller is connected, makes it so Input.is_action_pressed("rightAction") only returns true for the first frame, and then just returns false, making it so I can only move for one frame at a time with “WASD” when having a controller connected.

I tried with the D-pad and it works fine, it’s just a problem with InputEventJoypadMotion probably. Maybe it has to do with the deadzone setting on InputMap not working correctly, which I have set up as well in an attempt to fix it. Or I don’t know.

Does anyone know if this is a known issue or maybe if I’m missing how to fix it?

Thanks a lot for your time.

:bust_in_silhouette: Reply From: juppi

Hey Strelly,

thanks. I have a nice day :D. Hope you have 1 2.

What about using the Input.get_axis method?
It gives you a value between -1 and 1. So if the player just moves the stick a little, you’ll get a small value.

https://docs.godotengine.org/en/stable/classes/class_input.html#class-input-method-get-axis

Hello, thanks a lot for your answer,

I tried using that method, but the problem persisted, the only thing that changed is that, now, when holding down “WASD” while the controller is connected, it changes between “true” and “false” randomly, I’m guessing it’s not randomly, but it’s what it feels like.

Cheers!

Strelly | 2022-02-28 09:04