Using InputManager

Using InputManager

Note

The Pro Controller ZR button does not work with InputManager. This is a known bug. If you plan to use this button on the Pro Controller, use the Wii U API instead of using the InputManager.

There are two types of controls: joysticks and buttons. The settings for each of them are very different. InputManager calls the button mapping entries ‘axes’ (plural for axis). This gets confusing because there is also a setting for axis (as in x/y axis). To ease confusion, in this guide I’ll just call each button mapping ‘axes’ an entry.

Joysticks

This image shows how to set up the left joystick on the GamePad. Relevant settings are in the green boxes. Settings marked by red boxes are ignored for buttons and have no effect on behavior.

Settings:

Type: This is always ‘Joystick Axis’

Axis: This is divided by the X/Y axis for the left and right joystick.

  • X axis = x axis of the main joystick (left joystick)
  • Y axis = y axis of the main joystick (left joystick)
  • 3rd axis = x axis of the right joystick
  • 4th axis = y axis of the right joystick

Joy Num: Set this according to the numbers given below.

  • Joystick 2: GamePad.
  • Joystick 3-6: Pro Controller. Joystick 3 does not relate to the player number. It only means the first Pro Controller. If player 1 and 3 use Wii remotes, and player 2 and 4 use Pro Controllers, the Pro Controllers will be on Joystick 3 and Joystick 4.
  • Get Motion from all Joysticks: takes input from the GamePad and all connected Pro Controllers at the same time. This is not recommended.

Buttons

This image shows how to set up the A button on the GamePad. Relevant settings are in the green boxes. Settings marked by red boxes are ignored for buttons and have no effect on behavior.

To reference a button, enter the joystick number along with the button number. You can find the full list of button numbers in the Unity for Wii U documentation. For Unity 5.x, this is in Platform Specific > Wii U > Wii U Scripting > Wii U Joystick Aliases and Axes.

 

Example for the B button on the GamePad:

Positive Button: joystick 2 button 1

Type: Key or Mouse Button

 

Example for ‘up’ on the +Control Pad on the first Pro Controller:

Positive Button: joystick 3 button 12

Type: Key or Mouse Button

 

Note that you can assign both keyboard key presses and GamePad button presses to the same entry. The above image uses these settings to assign one entry to both the A button and the ‘a’ key:

Positive Button: joystick 2 button 2

Alt Positive Button: a

Type: Key or Mouse Button

 

Setting an alternate button to a keyboard key allows you to test your game more easily in the Unity Editor. Joystick input and key presses cannot be placed in the same entry, but you can make two entries with the same name to get the same results. For example:

Entry 1

Name: gamePadLeftJoyX

Type: Joystick Axis

Axis: X axis

Joy Num: Joystick 2

Entry 2

Name: gamePadLeftJoyX

Positive Button: up

Negative Button: down

Type: Key or Mouse Button

 

 

 

 


CONFIDENTIAL