- Home /
InputManager doesn't detect gamepad numbers correctly
I have a split-screen local multiplayer game. Each connected controller receives a split-screen, so that controller 1 is the upper left corner, controller 2 is the upper right corner, etc.
Lets say I have three 360 gamepads connected to a Windows PC. One through direct USB connection, the other two through the wireless receiver (if it matters).
In InputManager, I have all of the input mappings setup like so
Horizontal0
Shoot0
Jump0
Horizontal1
Shoot1
Jump1
etc...
So that the 360 controller marked at controller 1 would correspond to input mappings 0 and control the upper left screen, controller 2 would correspond to input mappings 1 and control the upper right screen, etc.
The problem I'm facing is that often (though not always) Unity will recognize the second 360 controller (I say second, because the upper right light ring is lit on the controller) as controller 1, and thus controls the player in the upper left corner split-screen, instead of the upper right corner split-screen as expected.
Is this just a known Unity quirk? Are there any known workarounds so that Unity always properly respects the controller numbers?
Answer by Neeko · Jan 07, 2014 at 06:48 PM
After some time, I can answer my own question.
This appears to be a common issue as reported here and unfortunately, there's no true solution.
My solution has been to use XInputDotNet instead of the built-in Unity InputManager which I can attest fixes the issue. Problem with that, it uses DirectX which means Windows only.
There's also XboxCtrlrInput which attempts to create a more multi-platform solution, using XInputDotNet on Windows and seemingly falling back to Unity's built-in InputManager for all other platforms.
Your answer
Follow this Question
Related Questions
Joystick Right-Stick Input for Rotating Camera 0 Answers
Is there a way to modify Input Manager so that an ax is be able simulate an input from code? 0 Answers
how to make a configurable input 1 Answer
How to read the input manager from a script 1 Answer
OnClick triggers twice because of UnityEngine.SendMouseEvents 0 Answers