I wasn’t exactly sure where to put this so i figured i would add a question and then post and answer for it! I had been searching around and couldn’t find a list of the controller mapping for an xbox one controller, on windows 10, in unity 5. So i went ahead and mapped all the buttons and axis.
Hope this helps some one!
EDIT: Guess i can’t answer my own question (or im just dumb :P) but heres the mapping!
I’m on Unity 5.6.1f1 using a wired Afterglow controller, and the right joystick axes are switched from what’s on this diagram (mine gives axis 4 for horizontal and axis 5 for vertical).
The front triggers are 9th and 10th axis on some controllers and are shared as a single 3rd axis on others.
So if you have a shared 3rd axis for the two front triggers it is only good to control one thing. One trigger creates a positive input and the other a negative input.
On my Xbox One controller (4N7-00002) the axes of the right analog stick are switched: Vertical is 5 and horiontal is 4 (so like in Bredjo’s image). Btw, with this model LT is indeed the 9th axis and RT the 10th axis (Type: Joystick Axis, Axis: 10th Axis (Joysticks), Joy Num: Get Motion from all Joysticks). I would recommend using some kind of time check, otherwise it’s way too sensitive (it’ll trigger every frame):
A list of the controller mapping for an xbox one controller, on windows 10, in unity 5. Too much cached data can cause various problems, and the error code 0x80072ee7 might not be the exception.
FYI - Gamepad riggers are working with new Input System (Gamepad Support | Input System | 1.0.2) running 2019.4.11f1 on a Mac using a Xbox controller (original Microsoft, 3rd party controller will not connect to Mac using Apple’s built in driver). Example visualizer scene worked for all axis and buttons.
However, with old Input Manager (required by many Unity Assets), trigger axis are not working, per above.
Mapping is also different than above in old Input Manager on Mac using Apple’s driver:
// left stick
float axisX = Input.GetAxis("Joystick Axis X");
if (axisX < -axisDead || axisX > axisDead) Debug.Log("Joystick Axis X = " + axisX);
float axisY = Input.GetAxis("Joystick Axis Y");
if (axisY < -axisDead || axisY > axisDead) Debug.Log("Joystick Axis Y = " + axisY);
// right stick
float axis3 = Input.GetAxis("Joystick Axis 3");
if (axis3 < -axisDead || axis3 > axisDead) Debug.Log("Joystick Axis 3 = " + axis3);
float axis4 = Input.GetAxis("Joystick Axis 4");
if (axis4 < -axisDead || axis4 > axisDead) Debug.Log("Joystick Axis 4 = " + axis4);
// dpad
float axis5 = Input.GetAxis("Joystick Axis 5");
if (axis5 < -axisDead || axis5 > axisDead) {
float axis6 = Input.GetAxis("Joystick Axis 6");
if (axis5 == 1 && axis6 == 1) Debug.Log("DPad Right");
if (axis5 == -1 && axis6 == 1) Debug.Log("DPad Down");
if (axis5 == 1 && axis6 == -1) Debug.Log("DPad Up");
if (axis5 == -1 && axis6 == -1) Debug.Log("DPad Left");
}
// trigger axis not found
// button A
if (Input.GetButtonDown("Joystick Button 1")) Debug.Log("Joystick Button 1 clicked");
// button B
if (Input.GetButtonDown("Joystick Button 2")) Debug.Log("Joystick Button 2 clicked");
// button unused
if (Input.GetButtonDown("Joystick Button 3")) Debug.Log("Joystick Button 3 clicked");
// button X
if (Input.GetButtonDown("Joystick Button 4")) Debug.Log("Joystick Button 4 clicked");
// button Y
if (Input.GetButtonDown("Joystick Button 5")) Debug.Log("Joystick Button 5 clicked");
// button left bumper
if (Input.GetButtonDown("Joystick Button 7")) Debug.Log("Joystick Button 7 clicked");
// button right bumper
if (Input.GetButtonDown("Joystick Button 8")) Debug.Log("Joystick Button 8 clicked");
// button start
if (Input.GetButtonDown("Joystick Button 12")) Debug.Log("Joystick Button 12 clicked");
Hello, my game controls are perfect on Windows 10 but they don’t work at all on XBOX (UWP BUILD)
How can I solve this problem? My game was already approved and on the Xbox store, I had to hide it.
For me all buttons work except 9th and 10th axis. I had to use 3rd axis for both triggers, Left trigger set to inverted in the input manager. Maybe 9th and 10 axis work in Unity’s new input system.
My older brother is trying to make a game and he wants to add controller compatibility.
What does the Right Trigger input look like in a input axis in the input manager?
Show an image like this: