01 — Input System Concepts

The problem with the old way

The classic Input Manager looks friendly at first:

if (Input.GetKeyDown(KeyCode.Space)) Jump();

But that line hard-wires Space. Add gamepad support and you're writing if (space OR joystick button 0). Add rebindable controls, touch, a pause menu that ignores gameplay keys... it collapses into spaghetti. Every serious project outgrows it.

The big idea: actions, not keys

The Input System flips the question from "which key is down?" to "did the player Jump?". Your code only ever talks about verbs; a data asset decides which physical controls trigger them.

Device control  ──binding──▶  Action  ──event/value──▶  Your C#
<Keyboard>/space ─────┐
<Gamepad>/buttonSouth ┴────▶  "Jump"  ──performed──▶   OnJump()

The vocabulary (memorize these five)

All of these live together in one Input Actions asset (.inputactions file) — the kit's is torn apart in 03 - The Input Actions Asset.

Events vs polling — the two ways C# consumes actions

// POLLING — ask every frame (great for continuous Values)
Vector2 move = moveAction.ReadValue<Vector2>();

// EVENTS — be told when something happens (great for Buttons)
jumpAction.performed += OnJump;

Button actions raise three events, in order: started (control touched), performed (it counts — pressed past the threshold), canceled (released). The platformer demo uses canceled for variable jump height; the puzzle demo uses started/canceled as press/release for dragging. Details in 04 - Reading Input in C Sharp.

Why this pays off for each game type in this kit

Next: 02 - Install and Project Settings