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

Problem joining multiple players using the same keyboard

Discussion in 'Input System' started by NPOCrushader, Mar 3, 2020.

  1. NPOCrushader

    NPOCrushader

    Joined:
    Oct 24, 2018
    Posts:
    5
    Hello!

    I am currently working on a local multiplayer game, and in the game we have a characterselect screen where you can join up to four players. The players are loaded in using the player input manager when a specific action is triggered. Overall joining in multiple persons are working fine when using multiple gamepads. However, we want to be able to support two player on the same keyboard, and this is where our problem lies.
    playerinputmanager.png

    I am able to join in one character, but that character can access both of the two different keyboard schemes. We are then also unable to join in another player using the other part of the keyboard. What I think could be the problem here is that when joining in a player, the controll scheme is set to <any> and since the paired device is the keyboard it blocks more instances of the same keyboard to be loaded?

    So I guess what my question here is, how can I set the controll scheme on the spawned in player prefab based on what button was pressed, and how can I have two instances of the same paired keyboard device?
     
    javisarias likes this.
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    ATM this isn't possible to do with PlayerInputManager out of the box. Split-keyboard needs to be scripted manually by pairing the keyboard to two players with different control schemes.

    It's been a frequent request to support split-keyboard out of the box. I've added a ticket to the backlog (ISX-337). Probably what we should do is have the PlayerInput machinery not just look at devices already paired but also take into account whether there's a control scheme not yet in use which would allow pairing the same device to a different user. This would implicitly make split-keyboard work.

    Won't happen for 1.0 but it's on the pile for after.
     
  3. javisarias

    javisarias

    Joined:
    Jan 21, 2017
    Posts:
    9
    > Probably what we should do is have the PlayerInput machinery not just look at devices already paired but also take into account whether there's a control scheme not yet in use which would allow pairing the same device to a different user.
    We really need this feature.

    Maybe this is something that could be configured in the PlayerInputManager
     
  4. ll3v3ll

    ll3v3ll

    Joined:
    Nov 14, 2014
    Posts:
    11
    +1 to multiplayer split keyboard support out-of-the-box

    Currently we are trying to figure out how to accomplish this with the new InputSystem.