Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Plug and play doesn't work with new devices

Discussion in 'Input System' started by ODINKONG, May 8, 2022.

  1. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    I'm having an issue where if a controller isn't plugged in when the game starts it never works.

    We would like to support steam remote play, which I have confirmed works with keyboard and mouse, but the issue is since the game has to be open before you initiate steam remote play there is no way to add another player with a different input while this bug persists.

    I'm wondering if I have things setup wrong or if I just need to call something whenever a device is plugged in to get plug and play working properly.
     
  2. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    It turns out what its actually doing is defaulting the second player to the keyboard if the other controller isn't plugged in. Is there a way to default to the controller once it's plugged in?
     
  3. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    Ok I've sort of solve the issue by just deactivating and reactivating the game objects governing both player inputs and event systems whenever a new device is plugged in, but this has another unintended consequence which is that if I disconnect both controller then move the mouse or press any key when I plug the controllers back in the first one to be plugged in becomes player 1.

    Is there some way to manage these inputs that I'm missing here? There really isn't much documentation on managing 2 controllers and the keyboard and mouse using the new input system.