Controller Not Recognized

Discussion in 'Programming' started by MattCast, Jul 18, 2019.

  1. MattCast

    MattCast Member

    Joined:
    Apr 2, 2017
    Posts:
    7
    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++;
    }
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice