- Home /
Accessing quadrant/joystick number when using multiple xbox 360 controllers
Hi, my team and I are currently developing a sidescroll platformer in which there can be as little as two players on screen, and as much as four. Everything works just fine, we're using Input.GetButtonDown for remappable keys and Input.GetKeyDown for unbindable keymappings (for menus and such).
Currently our project only supports Xbox 360 Controllers for Windows. The "problem" (note the quotation marks) is that quadrants in the controller (which supposedly display player number) are all mixed up when compared to the way Unity detects them. So you can have, say, player 2 having the quadrant for player 4 and player 4 having the quadrant for player 3 and such..
My question would be if there is a way of accessing gamepads in the order Windows detects them. Or if the quadrant information can be accessed somehow in order to rearrange player numbers accordingly.
I know it's not much of a "big deal" compared to what is found everyday on the site, but it really takes out the quality to the product we are aiming for.
Thanks for your time. :)
Answer by avatara359 · Jan 22, 2013 at 06:08 AM
I need to know this as well. The only possible solution I can think of is to map all 12 possible joysticks in the unity input editor and poll all 12 each frame. Then have each player 'press start' and detect that input and assign a 'unity joystick quadrant" number to grab all input from.
Is there a better way to make sure a "xbox 360 controller on quadrant 1" is assigned to "unity joystick 1"?
gee, at least I'm not alone on this boat. :) Let me know if you find something useful.