• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Controller Not Recognized

MattCast

Member
Hi. I have an issue connecting the Nintendo Switch Pro Controller to my game. This specific issue arises only when I connect it using a universal object that is created before everything else, where the game refuses to recognize it exists. When I place the exact same code in the get_input event, which is called only when the an object is already created, it works perfectly. However, this issue does not occur when I instead try to connect an Xbox One controller. No matter where I place the connection code, the Xbox controller connects flawlessly. I'm at a loss. Does anyone have any ideas?

Here is my connection code:

player_array[0] = -1;
player_array[1] = -1;
player_array[2] = -1;
player_array[3] = -1;
number_of_controllers = gamepad_get_device_count();
i = 0;
j = 0;
show_message(number_of_controllers);
for(j = 0; j < number_of_controllers && i < 4; j++){
if (gamepad_is_connected(j) == true){
player_array = j;
i++;
}
}
 
Top