Search Unity

Multiple Xbox 360 Controllers in Unity

Discussion in 'Editor & General Support' started by NuclearProductions, Mar 26, 2010.

  1. NuclearProductions

    NuclearProductions

    Joined:
    Mar 26, 2010
    Posts:
    3
    I'm having issues with the input for multiple controllers.
    At the moment, I have modified the Lerpz 2d platform demo so that it has 2 players running around. I have also modified the PlatformController script for the second character so that it accepts different input from the input manager.

    In the input manager, I've added a few more actions (Horizontal2, Jump2) as actions for the second player.

    Whilst I don't have any issues with character movement using the analogue sticks - left stick on one character makes the first character move and the left stick on the other controller makes the other character move, the issue comes from pressing a button to make the players jump.

    I've set it that the A button on the controller makes the player jump (joystick button 0) for both 'Jump' and 'Jump2' in the input manager. Also change the joy num to 1 for 'jump' and 2 for 'jump2'. However for some reason, both characters jump whenever I press the A button or either controller.

    Anyone know a solution to this?
     
    theLonelyWhale likes this.
  2. Zogg

    Zogg

    Joined:
    Mar 28, 2009
    Posts:
    158
    I had the same problem some weeks ago, took me a while to figure it out:

    Actually, the joystick specified in Joy num doesn't matter for buttons - what matters is the Positive button entry:
    Try replacing the entry "joystick button 0" by "joystick 1 button 0" respectively "joystick 2 button 0".
     
    angrypenguin and SHG like this.
  3. SHG

    SHG

    Joined:
    Oct 28, 2012
    Posts:
    8
    Words cannot describe how much you have helped me today!
     
    angrypenguin likes this.
  4. LuckyStreak

    LuckyStreak

    Joined:
    Apr 1, 2015
    Posts:
    9
    Where does it allow you to specify joystick 1 button 0?
     
  5. LuckyStreak

    LuckyStreak

    Joined:
    Apr 1, 2015
    Posts:
    9
    Where does it allow you to specify joystick 1 button 0? I don't see it listed in the input manager.
     
  6. LuckyStreak

    LuckyStreak

    Joined:
    Apr 1, 2015
    Posts:
    9
    In my situation, both gamepad one and two register both gamepad movements
     
  7. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
  8. VKronners

    VKronners

    Joined:
    Mar 24, 2016
    Posts:
    1
    MAN YOU SAFED MY FREAKING LIFE XDDDDDDDDDDDD I Was looking for this solution like for 2 months.
     
  9. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Last edited: Jan 27, 2019
  10. zra8

    zra8

    Joined:
    Sep 23, 2017
    Posts:
    1
    I love you Steven! I will always follow in your footsteps.
     
  11. jampakdd

    jampakdd

    Joined:
    Jul 8, 2014
    Posts:
    3
    I found you on discussion boards lol. This seems to be plaguing me!