- Home /
Controller inverted with Xbox Gamepad
My problem is kind of tricky : when I plug my first XBox controller, everything works good, but when I plug a second Xbox controller, it controls the first player, and the first gamepad controls the second player... I don't know if it's a Unity or Windows driver problem, but it causes some bugs when I use the triggers.
Is there someone else having this problem ? I found nothing on the forums about that...
EDIT : I tested the gamepads with the "joy.cpl" application, both controllers work well on Windows, so I think that's a Unity problem ?
EDIT 2 : I tried with this demo and got the same result
EDIT 3 : After plug the 2 controllers, if I unplug player 1 and replug it after a few seconds, it works well...
Answer by babaji1234 · Jul 05, 2014 at 10:27 AM
You must be using
if(Input.GetKey(KeyCode.JoystickButton[num])) //do stuff
It will work great on one controller but with two use something like
if(Input.GetKey(KeyCode.Joystick1Button[num])) //do stuff
this will check input only from one gamepad
Indeed. Input manager may have the Axes set to 'All Joysticks'. You can probably invert them there too.
Sorry nope I'm already using Joystick1Button and Joystick2Button
Your answer
Follow this Question
Related Questions
How to achieve rumble/vibrate for Xb360 gamepad? 0 Answers
Is there a way to fire the inspector events from code? 0 Answers
Mayflash Gamecube controller vibration 0 Answers
Controller Setup? 1 Answer
PS4 controller right analog stick issue 3 Answers