Gamepad problem

The second block of code appears flawed in its concept. First question, where is this code located? You'll probably want to check for button presses in the Step event of your player object, for instance. Is that where this code is?

The first argument to gamepad_button_check_pressed is the device number. So what your code is actually doing is looping through device numbers 0-199 to check if button 1 is pressed on them. There is a limit of 12 gamepad devices so checking above device 11 doesn't make any sense. What you want to do is capture the device number of your controller into a variable and reuse that any time you check for button presses.

So, in your first block of code you know the index of your gamepad and can capture it. Store the value of i into a variable. Then when you need to check for button presses, reuse that variable for the device number.

/r/gamemaker Thread