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

Joystick Input Problem

Discussion in 'Editor & General Support' started by elias723, Jun 4, 2006.

  1. elias723

    elias723

    Joined:
    Feb 10, 2006
    Posts:
    178
    Hello all you bright, attractive Unity people! I have a problem with the input that I'm getting from my joysticks. I have several scripts which change the axis they are using based on what the player number is :
    Input.GetAxis("" + playerNum + ".FireL1") is one example.
    I have possible player numbers from 0 to 3. Each script is properly getting the player number and my axes are properly named and separated by which controller they should input from, but for some reason when I press any BUTTON axis from any controller, Unity acts as if all the controllers had that button pressed. Perhaps I did something stupid, but this seems like a bug. I sent a bug report also, but hoped there would be someone here with an answer.

    Any ideas?
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    joystick buttons that are assigned to one particular joystick have to be named like this:

    joystick 0 button 0
    instead of:
    joystick button 0

    (The joystick number popup at the bottom doesn't affect this at all at the moment.)
     
  3. elias723

    elias723

    Joined:
    Feb 10, 2006
    Posts:
    178
    Aha! Thanks, Joe.