In this tutorial we’ll set up gamepad controls using the Unity Input System.
The controls will use a generic setup that’ll work for all gamepad brands, i.e. using buttons north, easth, south and west instead of specific buttons like A (XBox) or Square (Playstation).
This tutorial is based on the ORK 4 Unity Quickstart 3D tutorials, but can be used in any project.
You can download the finished input keys here:
Tip!
Did you know you can quickly set the GUID, i.e. the unique identifier of a data asset, to the name of the data asset?
The GUID information can be found at the top of the settings.
Click on the 2nd button to directly set the GUID to the name (excluding space).
The first button copies the GUID to the clipboard, the 3rd button opens the GUID editor to type in a new GUID.
GUIDs are e.g. used when displaying global text codes, e.g. the name of an input key. Having the GUID use the name makes this easier when you manually type in text codes – e.g. LeftStickHoriontal is easier to remember than 767706a3-5266-42d0-91b1-ffb9f5e1c295.
Left Stick #
We’ll start with the left stick controls – we’ll have 3 input keys for it, the horizontal axis, the vertical axis and the stick button (i.e. clicking on the stick.
Open the ORK editor and navigate to Controls > Input Keys, we’ll add multiple new input keys.
Left Stick Horizontal #
Add a new input key.
- Name
Set to: Left Stick Horizontal
Input ID Setting 0 #
- Input Origin
Select: Gamepad Button (Input System) - Button
Select: Left Stick - Axis Type
Select: X
Left Stick Vertical #
Copy the Left Stick Horizontal input key.
- Name
Set to: Left Stick Vertical
Input ID Setting 0 #
- Axis Type
Select: Y
Left Stick Button #
Copy the Left Stick Horizontal input key.
Both the horizontal and vertical inputs also get the button input from clicking on the stick. We’ll still set up a separate input key for the button input to have a clean gamepad mapping for each input, in case we want to add input rebinding later.
- Name
Set to: Left Stick Button
No other changes needed.
Right Stick #
The setup for the right stick is the same as for the left stick.
Right Stick Horizontal #
Copy the Left Stick Horizontal input key.
- Name
Set to: Right Stick Horizontal
Input ID Setting 0 #
- Input Origin
Select: Gamepad Button (Input System) - Button
Select: Right Stick
Right Stick Vertical #
Copy the Right Stick Horizontal input key.
- Name
Set to: Right Stick Vertical
Input ID Setting 0 #
- Axis Type
Select: Y
Right Stick Button #
Copy the Right Stick Horizontal input key.
- Name
Set to: Right Stick Button
No other changes needed.
D-Pad #
The D-Pad has 4 buttons, up, down, left and right.
Let’s start from scratch.
D-Pad Up #
Add a new input key.
- Name
Set to: D-Pad Up
Input ID Setting 0 #
- Input Origin
Select: Gamepad Button (Input System) - Button
Select: Dpad Up
D-Pad Down #
Copy D-Pad Up.
- Name
Set to: D-Pad Down
Input ID Setting 0 #
- Button
Select: Dpad Down
D-Pad Left #
Copy D-Pad Down.
- Name
Set to: D-Pad Left
Input ID Setting 0 #
- Button
Select: Dpad Left
D-Pad Right #
Copy D-Pad Left.
- Name
Set to: D-Pad Right
Input ID Setting 0 #
- Button
Select: Dpad Right
Buttons #
Next are the buttons – ORK uses the generic north, east, south and west names for the buttons. They’ll in turn use whatever gamepad’s button is used, e.g. south is A on XBox and Cross on PlayStation.
North #
Copy D-Pad Right.
- Name
Set to: Button North
Input ID Setting 0 #
- Button
Select: Button North
East #
Copy Button North.
- Name
Set to: Button East
Input ID Setting 0 #
- Button
Select: Button East
South #
Copy Button East.
- Name
Set to: Button South
Input ID Setting 0 #
- Button
Select: Button South
West #
Copy Button South.
- Name
Set to: Button West
Input ID Setting 0 #
- Button
Select: Button West
Shoulder #
There are the left and right shoulder buttons.
Left Shoulder #
Copy Button West.
- Name
Set to: Left Shoulder
Input ID Setting 0 #
- Button
Select: Left Shoulder
Right Shoulder #
Copy Left Shoulder.
- Name
Set to: Right Shoulder
Input ID Setting 0 #
- Button
Select: Right Shoulder
Trigger #
There are the left and right trigger buttons.
The triggers also provide an axis value (from 0 to 1).
Left Trigger #
Copy Right Shoulder.
- Name
Set to: Left Trigger
Input ID Setting 0 #
- Button
Select: Left Trigger
Right Trigger #
Copy Left Trigger.
- Name
Set to: Right Trigger
Input ID Setting 0 #
- Button
Select: Right Trigger
Menu #
There are the start and select buttons.
Start Button #
Copy Right Trigger.
- Name
Set to: Start Button
Input ID Setting 0 #
- Button
Select: Start
Select Button #
Copy Start Button.
- Name
Set to: Select Button
Input ID Setting 0 #
- Button
Select: Select
Save Changes #
And that’s it.
Don’t forget to click on Save Settings at the bottom of the editor to save the changes.


