How to use the Dualshock4 controller D-pad in Gdevelop?

hello, i’m implementing the control pad in my platform game, and i’ve managed to do all the moves. However, I can only use the left analog stick on the DualShock4 controller, and the analog stick is a bit inaccurate in my game. When trying to implement the digital directional (d-pad), Gdevelop simply ignores the UP DOWN LEFT RIGHT commands, even though they are present in the Gamepads extension. Does anyone know how to make the engine recognize these commands on the d-pad?

As I understand it, the same problem happens with the xbox360 control.

You add as another button like A, B, X

You can do some test just editing this sample and test GDevelop 5
In the main scene scroll until the external event named Controllers and edit that external event in the OR condition where the Stick is added just add another condition like in the picture.

First: Always exactly match parameter’s listed requirements. “left” is not the same as “LEFT”, even though it may work it can cause you issues down the road.
Second: The “Other” section is showing you non-controller specific labels. “UP” “DOWN” “LEFT” “RIGHT” etc works for any controller with a d-pad that shows up as a cross hatch, both XBOX, PS4, and generic (so long as it is a cross-hatch and not an axis).
Source: I am currently testing with Xbox, PS4, and PS5 controllers on my current game and all of them have working DPADs with the same event.

Edit: as Ulises mentions above, Left on the dpad is a button, and needs to be treated as such. You can join it with left stick controls using the OR condition along with the normal left stick controls.

Thanks a lot, I tried to use your tips and managed to get the d-pad recognized, thanks for the help!

1 Like