Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

What Works

Davis Silverman edited this page May 15, 2018 · 64 revisions

<- Back to the Wiki

This page is meant to tell end-users and developers what currently works. If something here claims to work but doesn't from your experience, report a bug.

Software Compatibility

  • The code in XboxCtrlrInput.cs and the example project should work in Unity 5.3 and above.
  • This class was mostly designed for desktop OS games in mind (macOS/Windows/Linux). This probably won't work for console or mobile development.

Vibration Output

XboxCtrlrInput does not support controller vibration output. More information can be read here: Concerning Vibration Output

Input Mappings

Controller Map

XboxInputMap

Environment Key

  • E = Unity Editor
  • P32 = Native Unity 32-bit Player
  • P64 = Native Unity 64-bit Player

Notice: Unity Web Player Support is discontinued.

Windows

Buttons
  • A, B, X, Y ( E, P32, P64 )
  • Start and Back ( E, P32, P64 )
  • LeftStick pressing ( E, P32, P64 )
  • RightStick pressing ( E, P32, P64 )
  • LeftBumper ( E, P32, P64 )
  • RightBumper ( E, P32, P64 )
Axis
  • LeftStickX ( E, P32, P64 )
  • LeftStickY ( E, P32, P64 )
  • RightStickX ( E, P32, P64 )
  • RightStickY ( E, P32, P64 )
  • LeftTrigger ( E, P32, P64 )
  • RightTrigger ( E, P32, P64 )
D-Pad
  • Up ( E, P32, P64 )
  • Down ( E, P32, P64 )
  • Left ( E, P32, P64 )
  • Right ( E, P32, P64 )

macOS

Buttons
  • A, B, X, Y ( E, P32, P64 )
  • Start and Back ( E, P32, P64 )
  • LeftStick pressing ( E, P32, P64 )
  • RightStick pressing ( E, P32, P64 )
  • LeftBumper ( E, P32, P64 )
  • RightBumper ( E, P32, P64 )
Axis
  • LeftStickX ( E, P32, P64 )
  • LeftStickY ( E, P32, P64 )
  • RightStickX ( E, P32, P64 )
  • RightStickY ( E, P32, P64 )
  • LeftTrigger ( E, P32, P64 )
  • RightTrigger ( E, P32, P64 )
D-Pad
  • Up ( E, P32, P64 )
  • Down ( E, P32, P64 )
  • Left ( E, P32, P64 )
  • Right ( E, P32, P64 )

Linux (Ubuntu 13.04 with default Xpad drivers)

Buttons
  • A, B, X, Y ( P32, P64 )
  • Start and Back ( P32, P64 )
  • LeftStick pressing ( P32, P64 )
  • RightStick pressing ( P32, P64 )
  • LeftBumper ( P32, P64 )
  • RightBumper ( P32, P64 )
Axis
  • LeftStickX ( P32, P64 )
  • LeftStickY ( P32, P64 )
  • RightStickX ( P32, P64 )
  • RightStickY ( P32 P64 )
  • LeftTrigger ( P32, P64 )
  • RightTrigger ( P32, P64 )
D-Pad
  • Up ( P32, P64 )
  • Down ( P32, P64 )
  • Left ( P32, P64 )
  • Right ( P32, P64 )

Multiplayer Input

This is a list of multiplayer (and single player) features for getting joystick input. These features have nicknames for future reference. When testing wireless controllers, they are turned off (by taking out the battery) to test reliability. The wireless receiver is not unplugged to test reliability.

Single Joystick Unplug Reliability

  • Windows ( E, P32, P64 )
  • macOS ( E, P32, P64 ) ( Player swapping may occur )
  • Linux ( P32, P64 ) ( Only for wireless controllers )

If a controller gets unplugged and you plug it back in the same port, the controller-to-player mapping should still work.

  • On Linux, a reconnected wired controller will simply not interact with the program. See Issue #9.

Multiple Joystick Unplug Reliability

  • Windows ( E, P32, P64 )
  • macOS ( E, P32, P64 ) ( Re-plug the controllers in the same order )
  • Linux ( P32, P64) ( Only for wireless controllers )

If multiple controllers gets unplugged and you plug them back in the same ports, the controller-to-player mapping should still work.

  • On Mac, if all controllers were disconnected, be sure to reconnect the controllers in the same joystick number order originally assigned. Otherwise, there will be controller swapping.
  • On Linux, a reconnected wired controller will simply not interact with the program. See Issue #9.

Pre-Game Ctrlr# to Plyr# Consistency

  • Windows ( E, P32, P64)
  • macOS ( E, P32, P64 )
  • Linux ( P32, P64 )

The number of controllers plugged in corresponds to the number of players being controlled when you plug in the controllers before opening the game (for example, the Example Demo) As an example, if you plug two controllers in, Player 1 and Player 2 should be able to move. Players 3 and 4 should not move in this example.

  • This feature assumes that no controller was unplugged while the game was open.
  • You have to ignore the player indicator light on your Xbox 360 controller when evaluating this feature. Issue #5 explains this.

Post-Game Ctrlr# to Plyr# Consistency

  • Windows ( E, P32, P64)
  • macOS ( E, P32, P64 )
  • Linux ( P32, P64 ) ( Only for wireless controllers )

The number of controllers plugged in corresponds to the number of players being controlled when you plug in the controllers after opening the game.

  • On Linux, this feature only works for wireless controllers, not wired controllers. Any connected wired controller will simply not interact with the program. See Issue #9.

Additional Joystick Connection Ctrlr# to Plyr# Consistency

  • Windows ( E, P32, P64)
  • macOS ( E, P32, P64 )
  • Linux ( P32, P64 ) ( Only for wireless controllers )

If one controller was plugged in before the game was open, adding a new controller during the game should still have a consistent player-to-controller mapping. For example, if the first joystick connected pre-game moves Player 1, then the new joystick connected during the game should be able to move Player 2.

  • On Linux, this feature only works for wireless controllers, not wired controllers. Any newly connected wired controller will simply not interact with the program. See Issue #9.

Level Changing Ctrlr# to Player# Consistency

  • Windows ( E, P32, P64 )
  • macOS ( E, P32, P64 )
  • Linux ( P32, P64 )

Assuming that the controllers are mapped to the correct player numbers, restarting or changing the level should keep that mapping consistent. In Unity, levels are restarted or changed with SceneManager.LoadScene().

  • This assumes that all the controllers you wanted to plug in were plugged in before starting the game.

<- Back to the Wiki