03 — The Input Actions Asset
Double-click Input/StarterKitControls.inputactions. The Actions editor opens with three columns:
- Action Maps (left):
Player2D,Player3D,Puzzle - Actions (middle): the verbs in the selected map, each expandable to show its bindings
- Properties (right): details of whatever is selected
Auto-save
Turn on Auto-Save (top-right of the window) or your edits silently vanish when you close it. Ask any student who lost twenty minutes.
Guided tour — things to click
Player2D → Move. Action Type is Value, Control Type Vector2. Expand it: a WASD composite, an Arrows composite, plus<Gamepad>/leftStickand<Gamepad>/dpad. Click the WASD composite open — four part bindings (up/down/left/right). This is how four keys become one Vector2.Player2D → Jump. Action Type Button. Two bindings:<Keyboard>/space,<Gamepad>/buttonSouth. Note the name — buttonSouth, not "A button": the same physical position works on Xbox (A), PlayStation (Cross), and Switch (B) pads.Player3D → Look. Bindings:<Mouse>/deltaand<Gamepad>/rightStick. Two very different devices, one action — 06 - First-Person and Weapon Switching shows the one place code cares about the difference.Player3D → NextWeapon. Binding:<Mouse>/scroll/up— a sub-control of the scroll vector used as a button. Plus<Gamepad>/rightShoulder.Puzzle → Point. Bindings:<Mouse>/position,<Pen>/position,<Touchscreen>/primaryTouch/position. Three device families, one drag-and-drop implementation.- Top-right control scheme dropdown:
Keyboard&MouseandGamepad. Each binding is tagged with a scheme — used for device switching and local multiplayer (08 - Going Further).
Exercise: add an action yourself
Add a Dash to Player2D:
- Select the
Player2Dmap → + next to Actions → name itDash. - Action Type: Button.
- Select its empty binding → Path → press the Listen button → tap Left Shift. (Listen mode beats scrolling the giant device tree.)
- Add a second binding:
<Gamepad>/buttonWest. - Auto-save is on, so it's saved. Wiring it into code is an exercise in 05 - 2D Platformer Movement.
Creating an asset from scratch (for your own games)
Assets → Create → Input Actions, name it, add maps/actions as above. Then either reference the asset from your scripts like this kit does, or use the PlayerInput component route (04 - Reading Input in C Sharp). The .inputactions file is just JSON — version-control friendly; diff it after edits and it's actually readable.