Xbox360Controller

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Still Tidying.)
(Rejigged the content, finished table, with little bit of blurb to aid in using it. Cut out the text surrounding images which are now in various sections.)
Line 1: Line 1:
This page specifies the controller bindings for several operating systems using the most commonly acquired drivers for each.
+
 
 +
 
 +
This page serves as a cross reference between Unity and the XBOX 360 contoller buttons/axis.
 +
 
 +
==Full controller support==
 +
 
 +
If you only build your game for Windows, you may be interested in [https://github.com/speps/XInputDotNet XInput.NET] which allows full XBox 360 controller support.
 +
For an InputManager.asset file with four XBox 360 controllers mapped [http://www.unifycommunity.com/wiki/images/a/a1/XBox360_Inputs.zip click here] or with separate axises for triggers: [http://www.mediafire.com/?mxu0c1dabogq1q6 click here]
 +
 
 +
==Configuration==
 +
 
 +
The sensitivity of the axises should be set to 1 for accurate reproduction. The Gravity of an axis should be set to 0.
 +
Axises should be configured with a dead zone to prevent them from producing an output of more than 0 when they are not moved. Since the centre return of the thumbsticks will cause the output to wander, they should be given a dead zone of around 0.2. The Triggers are firmer, and only require a deadzone of 0.1.
 +
 
 +
Buttons can either be fetched using '''Input.GetButton''', or, if using an axis in the InputManager, can be configured with a sensitivity of 1000.
 +
 
 +
==Bindings==
 +
 
 +
The controller bindings for several operating systems using the most commonly acquired drivers are specified below for:
  
 
* Windows tested against Windows 8.1 using default drivers
 
* Windows tested against Windows 8.1 using default drivers
Line 5: Line 23:
 
* Linux tested against Ubuntu 13.04 64-bit using the default driver
 
* Linux tested against Ubuntu 13.04 64-bit using the default driver
  
==Bindings==
+
Unity will only reference axises via the input manager, while buttons can be accessed via a string '''joystickbuttonX''' or through the KeyCode enum, where X is the number of the button provided in the table below. For example '''KeyCode.JoystickButton9''' would refer to the Right Stick Click on Windows, the Start Button on OS X, and the Left Stick Click on Linux on all controllers. For More infomation on how to use the data from the table below, refer to the [http://docs.unity3d.com/Manual/ConventionalGameInput.html manual]
  
Unity will only reference axises via the input manager, while buttons can be accessed via '''joystickbuttonX''' or through the KeyCode enum, where X is the number of the button provided in the table below. For example '''KeyCode.JoystickButton9''' would refer to the Right Stick Click on Windows, the Start Button on OS X, and the Left Stick Click on Linux.
+
===Axises===
  
{| border="1" class="wikitable"
+
{| border="1" class="wikitable" style="width:100%"
! rowspan="2" | Input  
+
! rowspan="2" style="width:18%" | Input  
! colspan="3" | Platform
+
! colspan="3" style="width:25%" | Platform
 
! rowspan="2" | Notes
 
! rowspan="2" | Notes
 
|-
 
|-
Line 18: Line 36:
 
! Linux
 
! Linux
 
|-
 
|-
! colspan="4" | Axis Mappings ||
+
! Axis Name
 +
! colspan="3" | Mapped Axis Number ||
 
|-
 
|-
 
! Left Stick X Axis
 
! Left Stick X Axis
| 0 || 0 || 0 ||
+
| x axis || x axis || x axis ||
 
|-
 
|-
 
! Left Stick Y Axis
 
! Left Stick Y Axis
| 1 || 1 || 1 ||
+
| y axis || y axis || y axis ||
 
|-
 
|-
 
! Right Stick X Axis
 
! Right Stick X Axis
Line 48: Line 67:
 
! Right Trigger
 
! Right Trigger
 
| 10 || 6 || 6
 
| 10 || 6 || 6
 +
|}
 +
 +
===Buttons===
 +
 +
{| border="1" class="wikitable" style="width:100%"
 +
! rowspan="2" style="width:18%" | Input
 +
! colspan="3" style="width:25%" | Platform
 +
! rowspan="2" | Notes
 +
|-
 +
! Windows
 +
! Mac Os X
 +
! Linux
 
|-
 
|-
! colspan="4" | Button Mappings ||
+
! Button Name
 +
! colspan="3" | Mapped Button Number ||
 
|-
 
|-
 
!A Button
 
!A Button
Line 99: Line 131:
 
|}
 
|}
  
This page serves as a cross reference between Unity and the XBOX 360 contoller buttons/axis.
+
==Picture References==
 
+
'''Full controller support'''
+
 
+
If you only build your game for Windows, you may be interested in [https://github.com/speps/XInputDotNet XInput.NET] which allows full XBox 360 controller support.
+
 
+
'''Using InputManager'''
+
 
+
NOTE: These are the button references for the controller on WINDOWS ONLY. The Mac and Linux layouts below differs slightly from this.
+
 
+
[[Image:X360Controller2.png]]
+
 
+
'''Buttons'''
+
 
+
Button sensitivity should be 1000
+
 
+
 
+
A = joystick button 0
+
 
+
B = joystick button 1
+
 
+
X = joystick button 2
+
 
+
Y = joystick button 3
+
 
+
LB = joystick button 4
+
 
+
RB = joystick button 5
+
 
+
Back = joystick joystick button 6
+
 
+
Start = joystick button 7
+
 
+
Left Analogue Press = joystick button 8
+
 
+
Right Analogue Press = joystick button 9
+
 
+
 
+
'''AXIS'''
+
 
+
Analog Axis sensitivity should be 1, digital should be 1000.
+
 
+
Left Analog Horizontal = X Axis
+
 
+
Left Analog Vertical = Y Axis
+
 
+
Triggers = 3rd Axis (Left: -1 - 0, Right: 0 - 1) _ (Left Trigger Axis: 9th, Right Trigger Axis: 10th (Both axis are 0-1))
+
 
+
Right Analog Horizontal = 4th axis
+
 
+
Right Analog Vertical = 5th axis
+
 
+
D-Pad Horizontal = 6th Axis
+
 
+
D-Pad Vertical = 7th Axis
+
 
+
 
+
'''Input Manager'''
+
 
+
 
+
InputManager.asset file with four XBox 360 controllers mapped: http://www.unifycommunity.com/wiki/images/a/a1/XBox360_Inputs.zip
+
 
+
InputManager.asset file with four XBox 360 controllers mapped w/seperate axis for R/L triggers: http://www.mediafire.com/?mxu0c1dabogq1q6
+
 
+
--[[User:Fishman92|Fishman92]] 22:34, 11 May 2011 (GMT)
+
--[[User:Ramen-sama|Ramen-sama]] 17:58, 8 March 2010 (PST)
+
 
+
 
+
----
+
 
+
 
+
== '''MAC OSX XBOX 360 CONTROLLER LAYOUT USING TATTIE BOGLE DRIVER
+
''' ==
+
 
+
In case anyone needs a Mac Version (using Tattie Bogle Driver), I've made a visual - please share...
+
[[File:Unity_360controller_mac_layout.png]]
+
 
+
 
+
----
+
 
+
==Linux Xbox 360 Controller Layout Using Ubuntu 13.04 with default xpad driver==
+
 
+
(Tested on a fresh install of Ubuntu 13.04 64-bit with the default driver. Build tested made with Unity 4.2. Not tested with xboxdrv driver.)
+
 
+
D-Pad mapped as two axis only works for wired Xbox controllers.
+
 
+
For wireless controllers:
+
 
+
-Left is button 11
+
 
+
-Right is button 12
+
 
+
-Up is button 13
+
 
+
-Down is button 14
+
  
 +
===Windows===
 +
[[Image:X360Controller2.png|600px]]
  
[[File:UnityLinuxMapping.png|725px]]
+
===Mac OS X===
 +
[[File:Unity_360controller_mac_layout.png|600px]]
  
--[[User:Jibran Syed|Jibran Syed]] ([[User talk:Jibran Syed|talk]]) 18:22, 13 September 2013 (CEST)
+
===Linux===
 +
[[File:UnityLinuxMapping.png|600px]]

Revision as of 15:26, 13 July 2015


This page serves as a cross reference between Unity and the XBOX 360 contoller buttons/axis.

Contents

Full controller support

If you only build your game for Windows, you may be interested in XInput.NET which allows full XBox 360 controller support. For an InputManager.asset file with four XBox 360 controllers mapped click here or with separate axises for triggers: click here

Configuration

The sensitivity of the axises should be set to 1 for accurate reproduction. The Gravity of an axis should be set to 0. Axises should be configured with a dead zone to prevent them from producing an output of more than 0 when they are not moved. Since the centre return of the thumbsticks will cause the output to wander, they should be given a dead zone of around 0.2. The Triggers are firmer, and only require a deadzone of 0.1.

Buttons can either be fetched using Input.GetButton, or, if using an axis in the InputManager, can be configured with a sensitivity of 1000.

Bindings

The controller bindings for several operating systems using the most commonly acquired drivers are specified below for:

  • Windows tested against Windows 8.1 using default drivers
  • Mac OS X tested against Mavericks and Yosemite using Tattie Bogle 0.12 controller driver
  • Linux tested against Ubuntu 13.04 64-bit using the default driver

Unity will only reference axises via the input manager, while buttons can be accessed via a string joystickbuttonX or through the KeyCode enum, where X is the number of the button provided in the table below. For example KeyCode.JoystickButton9 would refer to the Right Stick Click on Windows, the Start Button on OS X, and the Left Stick Click on Linux on all controllers. For More infomation on how to use the data from the table below, refer to the manual

Axises

Input Platform Notes
Windows Mac Os X Linux
Axis Name Mapped Axis Number
Left Stick X Axis x axis x axis x axis
Left Stick Y Axis y axis y axis y axis
Right Stick X Axis 4 3 4
Right Stick Y Axis 5 4 5
D-Pad X Axis 6 7 Only Wired Controllers Support D-Pad Buttons on Linux
D-Pad Y Axis 7 8
Triggers 3 The left trigger is represented by the range -1 to 0, while the right trigger is represented by the range 0 to 1.
Left Trigger 9 5 3 Windows supports a 0 to 1 range for both triggers. Mac OS X supports -1 to 1, however the trigger initially starts at 0 until it is first used.
Right Trigger 10 6 6

Buttons

Input Platform Notes
Windows Mac Os X Linux
Button Name Mapped Button Number
A Button 0 16 0
B Button 1 17 1
X Button 2 18 2
Y Button 3 19 3
Left Bumper 4 13 4
Right Bumper 5 14 5
Back Button 6 10 6
Start Button 7 9 7
Left Stick Click 8 11 9
Right Stick Click 9 12 10
D-Pad Up 5 13 Only Wireless Controllers Support D-Pad Buttons on Linux
D-Pad Down 6 14
D-Pad Left 7 11
D-Pad Right 8 12
Xbox Button 15

Picture References

Windows

X360Controller2.png

Mac OS X

Unity 360controller mac layout.png

Linux

UnityLinuxMapping.png

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox