Search Unity

Local Multiplayer with multiple gamepads

Discussion in 'Input System' started by rangar1984, Jan 19, 2022.

  1. rangar1984

    rangar1984

    Joined:
    Jan 10, 2020
    Posts:
    2
    Have local multiplayer set up with input manager, with player joins on press of a button. Works fine with keyboard/mouse and one gamepad. However with multiple xbox controllers, when button pressed it automatically joins to all the connected controllers. My question is, how do I have the player join and only connect to one of the connected controllers and not all of them?
     
  2. andrew_oc

    andrew_oc

    Unity Technologies

    Joined:
    Apr 16, 2021
    Posts:
    77
    Hi, if you have the PlayerInput Auto-switch property turned on, this will re-assign whatever gamepad was last pressed to the player. Could this be what is happening here? We automatically deactivate this functionality when multiple PlayerInput components exist in the scene, but it's unclear whether that's exactly your case.
     
  3. rangar1984

    rangar1984

    Joined:
    Jan 10, 2020
    Posts:
    2
    Auto-Switch is toggled off. This is what the input debugger shows
    upload_2022-1-19_8-0-47.png
    As soon as I press the button on one of the controllers it automatically assigns both controllers to the player. I want it to only assign one. Do I have to due this manually within my script or can this automatically be handled by playerinput or playerinput manager? Thanks for you help.
     

    Attached Files:

  4. UnkelRambo

    UnkelRambo

    Joined:
    Oct 26, 2012
    Posts:
    80
    Sorry to revive this, but @andrew_oc or @rangar1984 was there resolution to this?

    I just discovered that when I plug two XBox controllers in, they both map to the same PlayerInput and after a couple hours of searching I haven't found a solution.

    I'm on Input System 1.3.0 and my first pseudo-public playtest is supposed to happen Wednesday and haven't been able to test multiple XBox controllers until today (typical lol)

    Local Multiplayer is a huge selling point for me, and not being able to demo this with 4 players (keyboard+mouse and 3 XBox controllers) is going to wreck me o_O

    Any input (lel) would be appreciated.