03 — The Input Actions Asset

Double-click Input/StarterKitControls.inputactions. The Actions editor opens with three columns:

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

  1. Player2D → Move. Action Type is Value, Control Type Vector2. Expand it: a WASD composite, an Arrows composite, plus <Gamepad>/leftStick and <Gamepad>/dpad. Click the WASD composite open — four part bindings (up/down/left/right). This is how four keys become one Vector2.
  2. 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.
  3. Player3D → Look. Bindings: <Mouse>/delta and <Gamepad>/rightStick. Two very different devices, one action — 06 - First-Person and Weapon Switching shows the one place code cares about the difference.
  4. Player3D → NextWeapon. Binding: <Mouse>/scroll/up — a sub-control of the scroll vector used as a button. Plus <Gamepad>/rightShoulder.
  5. Puzzle → Point. Bindings: <Mouse>/position, <Pen>/position, <Touchscreen>/primaryTouch/position. Three device families, one drag-and-drop implementation.
  6. Top-right control scheme dropdown: Keyboard&Mouse and Gamepad. 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:

  1. Select the Player2D map → + next to Actions → name it Dash.
  2. Action Type: Button.
  3. Select its empty binding → Path → press the Listen button → tap Left Shift. (Listen mode beats scrolling the giant device tree.)
  4. Add a second binding: <Gamepad>/buttonWest.
  5. 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.

Next: 04 - Reading Input in C Sharp