Returns the current position of an analogue button.


gamepad_button_value(device, button);

Argument Description
device Which gamepad device "slot" to check.
button Which gamepad button constant to check for.

Returns: Real


With this function you can get the current value of an analogue button, from 0 to 1, where 0 is no pressure and 1 is full pressure.


speed = gamepad_button_value(0, gp_shoulderrb) * 4;

The above code uses the analogue trigger value from the gamepad plugged into device "slot" 0 to set the speed of the instance.

Back: GamePad Input
Next: gamepad_set_vibration
© Copyright YoYo Games Ltd. 2018 All Rights Reserved