Joystick/Controller

From Unity3D

Jump to: navigation, search

Extra resources/notes to consider before reading on:


Contents

Generic Controller

  1. Plug in your controller before opening Unity.
  2. Open the Input Manager ( Edit >> Project Settings >> Input) and the Input Manager will open in the Inspector.
  3. The number of input devices is 17. The maximum number of inputs Unity will allow is 80 inputs. (4 joysticks, each with 20 buttons)
  4. Analog stick / Dpad buttons / Trigger buttons are all “Joystick Axis” and all joystick axis needs to be inverted. (Analog Axis sensitivity should be 1, digital should be 1000.)
  5. Button sensitivity should be 1000.
    The Input Manager in Unity (click for larger version)


Microsoft Xbox 360 Controller

General mapping of the Xbox 360 Controller (click image for larger version)
Buttons (Key or Mouse Button) Axis (Joystick Axis)
joystick button 0 = A X axis = Left analog X
joystick button 1 = B Y axis = Left analog Y
joystick button 2 = X 3rd axis = LT/RT
joystick button 3 = Y 4th axis = Right analog X
joystick button 4 = L 5th axis = Right analog Y
joystick button 5 = R 6th axis = Dpad X
joystick button 6 = Back 7th axis = Dpad Y
joystick button 7 = Home
joystick button 8 = Left analog press
joystick button 9 = Right analog press


Arcade Stick for Sony Playstation 3

Arcade Stick Configuration (click for larger version)
Buttons (Key or Mouse Button) Axis (Joystick Axis)
joystick button 0 = Square X Axis = LeftAnalogX
joystick button 1 = X Y Axis = LeftAnalogY
joystick button 2 = Circle 3rd Axis = RightAnalogX
joystick button 3 = Triangle 4th Axis = RightAnalogY
joystick button 4 = L1 5th Axis = Dpad X
joystick button 5 = R1 6th Axis = Dpad Y
joystick button 6 = L2
joystick button 7 = R2
joystick button 8 = Select
joystick button 9 = Right analog press
joystick button 10 = (to be updated)
joystick button 11 = (to be updated)
joystick button 12 = Home

Sample

Below is a joystick demo
http://wiki.etc.cmu.edu/unity/images/2/27/Joysticks.zip

Personal tools