In a previous blog post, I covered the Unity Input details for using the Xbox One controller connected to a Windows 10 PC.
Part 11: Using an Xbox One Controller with Unity on Windows 10
Things get more interesting with the release of the Xbox One-S which now comes with Bluetooth enabled Controllers supporting wireless controller gameplay. The controller can be purchased separately at various online retailers (Xbox-Wireless-Controller-White). The Xbox Controller can be paired with HoloLens and other devices over Bluetooth and recognized by Unity on most supported platforms.
I recently acquired a Google Pixel XL for use with the Daydream View so I wanted to try out the Xbox Controller instead of the usual Bluetooth gamepads.
The setup is much like any other Gamepad over Bluetooth, on the phone settings turn on Bluetooth and then press the Connect button on the Xbox controller (Make sure batteries are fully charged and powers up the controller). The controller should eventually get listed in the detected devices and you can then initiate pairing.
Following is the table of joystick button and axis assignments I found for the Xbox One S (White) controller on the Pixel XL running Android 7.1 and using Unity 5.4.2f2
A | joystick button 0 |
B | joystick button 1 |
X | joystick button 13 |
Y | joystick button 2 |
Left Bumper | joystick button 3 |
Right Bumper | joystick button 14 |
View (Back) | joystick button 4 |
Menu (Start) | joystick button 5 |
Left Stick Button | joystick button 6 |
Right Stick Button | joystick button 7 |
Left Stick “Horizontal” (X) | X Axis |
Left Stick “Vertical” (Y) | Y Axis |
Right Stick “HorizontalTurn” (X) | 3th Axis |
Right Stick “VerticalTurn” (Y) | 4th Axis |
DPAD – Horizontal (X) | 5th Axis |
DPAD – Vertical (Y) | 6th Axis |
Left Trigger | 14th Axis |
Right Trigger | 15th Axis |