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

What Works

Jibran Syed edited this page Sep 12, 2013 · 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 should work in Unity 4.x and above.
  • It might work in previous versions as long as they support joystick input.
  • The example project requires Unity 4.2 or above (mostly due to the free text asset serialization).
  • This class was mostly designed for desktop OS games in mind (Mac/Windows/Linux). This probably won't work for console or mobile development.

Mappings

Input Map

XboxInputMap

Environment Key

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

Windows

Buttons
  • A, B, X, Y ( E, W, P32, P64 )
  • Start and Back ( E, W, P32, P64 )
  • LeftStick pressing ( E, W, P32, P64 )
  • RightStick pressing ( E, W, P32, P64 )
  • LeftBumper ( E, W, P32, P64 )
  • RightBumper ( E, W, P32, P64 )
Axis
  • LeftStickX ( E, W, P32, P64 )
  • LeftStickY ( E, W, P32, P64 )
  • RightStickX ( E, W, P32, P64 )
  • RightStickY ( E, W, P32, P64 )
  • LeftTrigger ( E, W, P32, P64 ) ( Single player only )
  • RightTrigger ( E, W, P32, P64 ) ( Single player only )
  • Note: Trigger input not working on Windows with multiple controllers. Refer to Issue #4
D-Pad
  • Up ( E, W, P32, P64 )
  • Down ( E, W, P32, P64 )
  • Left ( E, W, P32, P64 )
  • Right ( E, W, P32, P64 )

Mac OSX

Note: Input in native 64-bit builds not working. See Issue #1.

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

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
  • Note: Does not work with wireless controllers yet. See Issue #7.
  • 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 ) ( Only for wireless controllers )
  • Mac ( E, W, P32 ) ( 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.

  • In Mac Web Player, unplugging sometimes swaps controller ID and player ID. This swapping usually occurs if the first connected player disconnects. For example, if two controllers are plugged in, and Player 1's controller disconnects, Player 2's controller starts to control Player 1 and the re-plugged controller will control Player 2.
  • On Windows and Linux, this feature only works for wireless controllers, not wired controllers.
  • On Windows, wired controllers get mapped to a joystick number inappropriate to the number of controllers plugged in. This newly mapped joystick number is generally unpredictable. For example, if controller 1 was wired and disconnected, reconnecting it could re-map it's player control to Player 3, Player 4, or maybe even a larger number depending on how many controllers were plugged in prior. See Issue #6.
  • On Linux, a reconnected wired controller will simply not interact with the program. See Issue #9.
  • This feature does not work at all on the Windows Web Player. See Issue #8.

Multiple Joystick Unplug Reliability

  • Windows ( E, P32, P64 ) ( Only for wireless controllers )
  • Mac ( E, W, P32 ) ( 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 Windows and Linux, this feature only works for wireless controllers, not wired controllers.
  • On Windows, wired controllers get mapped to a joystick number inappropriate to the number of controllers plugged in. This newly mapped joystick number is generally unpredictable. For example, if controller 1 was wired and disconnected, reconnecting it could re-map it's player control to Player 3, Player 4, or maybe even a larger number depending on how many controllers were plugged in prior. See Issue #6.
  • On Linux, a reconnected wired controller will simply not interact with the program. See Issue #9.
  • This feature does not work at all on the Windows Web Player. See Issue #8.

Pre-Game Ctrlr# to Plyr# Consistency

  • Windows ( E, W, P32, P64)
  • Mac ( E, W, P32 )
  • 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)
  • Mac ( E, W, P32 )
  • 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. This is just a test to evaluate joystick reliability in-game. Depending on the complications, getting this to work might not be high priority.

  • 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.
  • This feature does not work at all on the Windows Web Player. See Issue #8.

Additional Joystick Connection Ctrlr# to Plyr# Consistency

  • Windows ( E, P32, P64)
  • Mac ( E, W, P32 )
  • 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.
  • This feature does not work at all on the Windows Web Player. See Issue #8.

Level Changing Ctrlr# to Player# Consistency

  • Windows ( E, W, P32, P64 )
  • Mac ( E, W, P32 )
  • 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 Application.LoadLevel().

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

<- Back to the Wiki

Clone this wiki locally