- Home /
Xbox controller mixed up
Hi,
I am having an issue where my 2 pc xbox controllers work fine in the editor, yet when I do a standalone windows build they get mixed up. By mixed up I mean controller #1 reads as joystick #2 and vice versa. On top of that the triggers behave very strangely, in that they only show input when BOTH controllers are pressing the trigger at the same time.
This also happens somewhat randomly. Has anyone experienced this or knows of a workaround?
I'm having the same issue and it get's worse as you go upwards to 3 and 4 controllers. Any solution for this?
I am also having the same problem. If I restart Unity with only one controller connected, my 1st player works fine, but my second controller is behaving the same way as mentioned above: buttons are fine, sticks are reversed, and triggers are as confusing as you said.
With the triggers you should look into the issue surrounding them both being bound to axis 3. I think there is a plugin called "in control" which helps to fix the issues generated by this problem. Take a look here at their website for their explanation of the problem, this may not be the cause of your issue but it is something worth reading if you are using xbox xbox controllers rather than PC xbox controllers(which $$anonymous$$icrosoft did not do this with).
http://www.gallantgames.com/posts/29/speculation-unity-and-xbox-controllers
I would recommend using XInputdotnet https://github.com/speps/XInputDotNet
Download and follow the instructions. It handles support for 4 controllers, as well as providing access to the motors in the controllers, letting you provide vibration feedback. Works perfectly in standalone builds as well.
Answer by ChrisClark13 · May 07, 2017 at 11:14 AM
If you start a Unity game (or even the editor itself) with more than one controller plugged in, this issue happens every time. What happens is that somehow Unity gets confused about which axises are supposed to be mapped to each controller.
The fix is to start the game with NO controllers plugged in and then plug in the controllers in the desired player order one at a time. To make sure you don't have the issue pop up again, wait a while after plugging in a controller to plug in the next one.
Or you can use XInput or DirectInput.
Thanks dude! I really wish this would get fixed, though, because that's going to be a huge drawback when developing my multiplayer game. :/
How would I go about using xinput?
Answer by maclark86 · May 11, 2016 at 03:52 PM
Running Unity 5.3.4 in Windows 10. One Xbox 1 controller works as intended, buttons, triggers, and sticks. Two or more controllers, the buttons and sticks work fine, but the triggers get confused. Such as needing to pull triggers on two or more controllers for anything to happen. Or pulling triggers on two controllers, then letting up on one, and then it starts reading input. Has this been solved for 360 controllers? If so, I could just switch to those in place of the Xbox 1 controllers. The XInputDotNet looks a little intimidating to me at my level right now.
Your answer
