[HOWTO] How To: Map Joystick Buttons to Response Menu

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Map Joystick Buttons to Response Menu

Post by Tony Li »

The default configuration for response menus is to allow the Unity UI EventSystem to let players navigate and click response buttons. However, some games map joystick buttons (e.g., A, B, X, Y) to menu buttons. A common configuration is similar to The Walking Dead for consoles:

Image

To set up you menu similarly to the image above, create 4 StandardUIResponseButton buttons and assign them to the StandardUIMenuPanel's Buttons list. Make a note of each button's element number so you can use it in [position=#] markup tags any time you want to. Bioware games often do this, putting "good" and "evil" responses in specific positions.

Next, add a UI Button Key Trigger to each button. Assign an input key code and/or button name to each one (e.g., "JoystickButton0", "JoystickButton1", etc).

If you're using the Input System package, set up the Dialogue System's new Input System integration. Select menu item Tools > Pixel Crushers > Dialogue System > Welcome Window, and tick the NEW_INPUT_SYSTEM checkbox and set up a small script as directed in the Input_Device_Manager.pdf located in Plugins / Pixel Crushers / Common / Documentation.

Tip: Make sure your responses are assigned to an actor (such as Player) whose Is Player checkbox is ticked. Unless you've changed the actor's node color, these nodes will appear in blue:

twd.png
twd.png (35.84 KiB) Viewed 294 times
Post Reply