Gamepad Actions Library


Gamepad Actions

GameMaker Studio 2 has a number of dedicated actions that can be used to detect both analogue and digital controls from multiple connected game pads. These actions require you to specify a gamepad index value, which is a number (counting from 0) that represents the gamepad being selected. Note that when a gamepad is plugged in to your device (or it is removed) then an asynchronous System Event is triggered (however to deal with this you may need to use code).

The gamepad "slots" are indexed from 0 with slots 0 - 3 inclusive being only for Xinput gamepads, ie: Xbox360 controllers and compatibles. However you can also check slots 4 - ii inclusive for DirectInput gamepads, which means you can detect many other models of controller when connected through these slots.

The available gamepad actions are all listed below:

Get Gamepad Axis Value Gamepad Get Axis
Get Gamepad Trigger Value Gamepad Get Trigger
Get Gamepad Count Value Gamepad Get Count
Get Connected Trigger Value Gamepad Get Connected
Set Gamepad Axis Deadzone Gamepad Set Axis Deadzone
Check Button If Gamepad Button Pressed
Detect Button Down If Gamepad Button Down
Detect Button Release If Gamepad Button Released


Compatibility


The following list shows current compatibility across the platforms (note that this will change with future updates):