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

Is there a way to get a unique Joystick id?

Discussion in 'Scripting' started by TareqProjects, Aug 10, 2018.

  1. TareqProjects

    TareqProjects

    Joined:
    Jun 27, 2016
    Posts:
    55
    Hello all,

    I got 2 joysticks with different mappings on both. Right now, the mapping swap whenever I restart my computer or generally plugging the joysticks in. Is there a way to identify the joysticks being connected so that I can bind a set of controls to them?
     
  2. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
  3. TareqProjects

    TareqProjects

    Joined:
    Jun 27, 2016
    Posts:
    55
    That's exactly what I have now. The issue is that the controls would swap between joystick inputs whenever I power on my computer. Is there a way to make it so that the left physical joystick is always Joystick 1 and the right physical joystick is Joystick 2?
     
  4. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    From reading this reply apparently "There are open-source C# XInput libraries out there you could use." . . . . ?