Search Unity

Question How to detect gamepads individually in New Input System?

Discussion in 'Input System' started by fhenri7, Mar 24, 2023.

  1. fhenri7

    fhenri7

    Joined:
    Jan 14, 2020
    Posts:
    1
    Good morning guys! This is my first post here.

    Is there any way to detect which gamepad was triggered via the New Input System? I'm working on a project for up to 4 simultaneous local players, however, when I use the gamepad, all players receive the input, since the New Input System does not differentiate the gamepads individually. In this case, I have a script responsible for receiving the inputs, and this same script is consulted by the other instances that interpret the inputs.

    Thank you very much in advance.
     
  2. TargetSoundFx

    TargetSoundFx

    Joined:
    Oct 6, 2016
    Posts:
    239
    Hi,

    You can download the sample included in the Package Manager that give you an example to create inputs for a local multiplayer game.

    In the Input Manager section click on Samples

    SimpleMultiplayer_0.png

    Then press the Import button in the section Simple Multiplayer.

    SimpleMultiplayer.png

    There are good videos on Youtube too.

    Hope it helps.