Search Unity

Issue using 2 gamepads for local multiplayer : inputs not detected

Discussion in 'Editor & General Support' started by Snake9, Jun 20, 2019.

  1. Snake9

    Snake9

    Joined:
    Nov 18, 2016
    Posts:
    30
    Hello,

    For a project, I want to be able to use 2 gamepads controller (x-box one gamepads) at the same time. However, when the 2 gamepads are connected to the PC before I run the game, none of them work : there is no input detected at all.

    I made an empty project with the default scene and only one script called "RecordControllerInput" that I got from here : https://stackoverflow.com/questions...oller-works-on-editor-but-not-on-builded-game

    Then I made some tests :

    1) When I connect only one gamepad to the PC and launch the game, inputs are detected. Everything is working fine.

    2) When I connect 2 gamepads to the PC, and then I launch the game, the gamepads are well detected (they appear in Input.GetJoystickNames() array) but no inputs are detected, unless I press a button on the other gamepad or move its stick.
    For example, if I move the left stick of joystick 1, and press a button on joystick 2 while keeping to move the left stick of joystick 1, the button pressed on joystick 2 is detected. But if I press any button or move any stick of one gamepad without touching the other, nothing happens.

    3) If I launch the game first, then connect the gamepads one after the other, it works : inputs are detected for both gamepads.

    I have the problem in the build AND in the editor (but for the editor, I have to quit it and relaunch it to simulate the relaunch of the build game.

    One of the gamepads is wireless and have a bluetooth USB key to connect with, the other is plugged on USB port by wire.
    I am using Unity 2018.3.7f1 and I could reproduce the issue with Unity 2019.1.7f1.

    What can be the cause of the problem ?
     
    Last edited: Jun 20, 2019