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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

splitting keyboard into 4 players bug

Discussion in 'Input System' started by nirsivan204, Jun 23, 2022.

  1. nirsivan204

    nirsivan204

    Joined:
    Nov 16, 2020
    Posts:
    2
    Hello everyone.
    I am working on a local multiplayer game, and used the example from here to split the keyboard into 2 players:
    https://docs.unity3d.com/Packages/c.../api/UnityEngine.InputSystem.PlayerInput.html

    When im trying to split to 3, it works fine. BUT when I am trying to split to 4, the last player control scheme doesnt seem to respond.
    my code:

    var p1 = PlayerInput.Instantiate(PIM_component.playerPrefab,
    controlScheme: "Keyboard1", pairWithDevice: Keyboard.current);
    var p2 = PlayerInput.Instantiate(PIM_component.playerPrefab,
    controlScheme: "Keyboard2", pairWithDevice: Keyboard.current);
    var p3 = PlayerInput.Instantiate(PIM_component.playerPrefab,
    controlScheme: "Keyboard3", pairWithDevice: Keyboard.current);
    var p4 = PlayerInput.Instantiate(PIM_component.playerPrefab,
    controlScheme: "Keyboard4", pairWithDevice: Keyboard.current);

    can it be a bug?
    all keyboards 1,2 and 3 are working perfectly.
    Thank you,
    Nir
     
  2. nirsivan204

    nirsivan204

    Joined:
    Nov 16, 2020
    Posts:
    2
    nevermind, when creating the new control schemes for keyboard 4 i forget to add keyboard as required