๐๏ธ Lesson 3.1: Why the New Input System & Installing It
In Fundamentals you read the keyboard with Input.GetKey and friends โ the legacy Input Manager. It works, but it hard-codes device names, can't rebind at runtime, and scatters polling all over your Update loops. Unity's modern Input System package fixes all of that. This lesson explains why it exists, then walks you through installing it and flipping the one Player Setting that turns it on.
๐ฏ Learning Objectives
By the end of this lesson, you will be able to:
- Explain the limits of the legacy
Inputclass you used in Fundamentals - Describe the four big wins of the new Input System: device-agnostic input, rebinding, local multiplayer, and event-driven code
- Install the Input System package from the Package Manager
- Choose the right Active Input Handling setting (Input System Package / Both) and know why the Editor restarts
- Recognise the difference between polling and action-based input
Estimated Time: 35 minutes ยท Prerequisite: Lesson 2.4 (ScriptableObject Event Channels) and the legacy Input class from Fundamentals
In This Lesson
A Quick Look Back at the Legacy Input Class
In Fundamentals, moving a character looked something like this:
void Update()
{
float h = Input.GetAxis("Horizontal"); // A/D or arrow keys
float v = Input.GetAxis("Vertical"); // W/S or arrow keys
if (Input.GetKeyDown(KeyCode.Space))
Jump();
transform.Translate(new Vector3(h, 0, v) * speed * Time.deltaTime);
}
This is polling: every single frame you ask "is Space down right now?" It's simple and it works for a keyboard demo. But look closer and the cracks show:
KeyCode.Spaceis baked into the code. Want players to rebind jump to another key? You'd have to write all that plumbing yourself.- A gamepad's "A button" is a completely different code path. Supporting keyboard and controller means branching input everywhere.
- The string axes (
"Horizontal") live in an old Input Manager window that predates most of modern Unity. - There's no clean way to know which player pressed a button when two controllers are plugged in.
None of this is a knock on what you learned โ polling is the right first tool. But a real game outgrows it fast.
Why a New System?
The Input System package reframes input around actions ("Move", "Jump", "Fire") instead of specific keys. Your gameplay code says "the player wants to jump" and never cares whether that came from a spacebar, a gamepad button, or a touchscreen tap. Four concrete wins fall out of that idea:
๐ Definition
Action: a named intent in your game (Move, Jump, Fire) that one or more physical controls are bound to. Your code responds to the action; the bindings decide which hardware triggers it.
- Device-agnostic. Bind Jump to the spacebar and the gamepad south button once. Plug in a controller mid-game and it just works โ no extra code.
- Rebinding. Because actions and bindings are data, you can let players remap controls at runtime. We build exactly that in the Module 3 mini-project.
- Local multiplayer. The system pairs devices to players automatically, so "Player 2's gamepad" is a first-class concept rather than something you hack together.
- Event-driven, not polled. Instead of checking every frame, the system calls your method the moment an action fires โ cleaner code and no missed presses on slow frames.
๐ก The mental shift. Legacy input asks the hardware questions ("is this key down?"). The new system lets the hardware tell you when something happened ("Jump was performed"). It's the same shift from checking a mailbox every minute to just getting a notification.
Polling vs. Actions
Here is the two approaches side by side. Notice how the legacy path ties gameplay directly to specific keys and devices, while the action path routes every device through one shared action that your code listens to:
Figure 1: Every device funnels into one Action; your code reacts to the Action, not the hardware.
That single funnel is the whole point. Add a new device tomorrow and you add a binding, not a new branch in Update.
Installing the Package
The Input System ships as a package, so you pull it in through the Package Manager just like any other Unity package.
- Open Window โธ Package Manager.
- At the top-left, set the source dropdown to Unity Registry (not "In Project").
- Type
Input Systemin the search box. - Select Input System in the list and click Install (bottom-right).
In Unity 6, the Input System is a verified package, so you'll get a stable version automatically โ no need to hunt for a specific number.
โ Pro Tip
If a brand-new project's template already lists Input System under In Project, you're done โ skip straight to the Active Input Handling check below. Many Unity 6 templates now include it out of the box.
Active Input Handling
The moment you install the package, Unity pops a dialog offering to enable the new backend and disable the old one. Whether you click yes or not, the underlying switch lives in Edit โธ Project Settings โธ Player โธ Active Input Handling. This dropdown decides which input backend Unity compiles into your game:
Your three choices:
- Input Manager (Old) โ only the legacy backend. The new APIs won't exist.
- Input System Package (New) โ only the new backend. The clean, forward-looking choice for a fresh project. Any lingering
Input.GetKeycalls will throw at runtime. - Both โ both backends compiled in at once. Slightly heavier, but it lets old and new code coexist while you migrate.
โ Which should you pick?
For a course project where you might still have a stray legacy call around, choose Both โ it's the safest way to learn without breakage. For a clean production project built entirely on the new system, choose Input System Package (New) so old habits can't sneak back in.
The Restart & What Changed
Changing Active Input Handling swaps a compiled backend, so Unity must restart the Editor to apply it. Accept the prompt and let it relaunch โ nothing is lost, and this is expected behaviour, not a crash.
โ ๏ธ "All compiler errors must be fixed" after switching to New-only
If you set the dropdown to Input System Package (New) and your project still calls Input.GetAxis or Input.GetKey anywhere, those lines no longer compile and the Editor blocks Play mode. Either delete/replace the legacy calls or set the dropdown to Both while you migrate.
Once the Editor is back, confirm the install worked by checking that a new menu path exists: right-click in the Project window and you should see Create โธ Input Actions. That asset type is the star of the next lesson.
๐ Sanity check in code. With the package installed you can now write using UnityEngine.InputSystem; at the top of a script with no red squiggle. If that namespace resolves, the backend is live.
Hands-on Challenge
๐๏ธ Exercise 1: Install and switch the backend
Objective: Get your project running on the new Input System.
- Open Window โธ Package Manager, switch the source to Unity Registry, search
Input System, and install it. - When the enable dialog appears, accept it (or set it manually under Edit โธ Project Settings โธ Player โธ Active Input Handling).
- Choose Both so nothing breaks while you learn.
- Let the Editor restart.
- Create an empty C# script and add
using UnityEngine.InputSystem;at the top โ confirm it compiles with no error.
๐ก Hint: I don't see the enable dialog
Some Unity 6 templates ship with the package pre-installed, so no dialog appears. Just open Player Settings and verify Active Input Handling is set to Both or Input System Package (New). If you change it, accept the restart.
โ Success check
The Editor has restarted, using UnityEngine.InputSystem; resolves with no red underline, and Create โธ Input Actions appears in the Project window's right-click menu.
๐๏ธ Exercise 2: Spot the difference
Find one script from a Fundamentals project (or write a two-line snippet) that uses Input.GetKeyDown. In a comment above it, write which of the four wins (device-agnostic, rebinding, multiplayer, event-driven) that line is missing out on. This trains your eye to notice where the new system would help.
๐ฏ Quick Quiz
Question 1: What is the core idea the new Input System is built around?
Question 2: You still have some legacy Input.GetKey calls but want to start using the new APIs too. Which Active Input Handling setting is safest?
Question 3: Why does Unity restart the Editor when you change Active Input Handling?
Summary
๐ Key Takeaways
- The legacy
Inputclass polls specific keys and devices every frame โ fine for demos, limiting for real games. - The new Input System is built on Actions: named intents that devices are bound to, so gameplay code never names hardware.
- Four wins: device-agnostic input, runtime rebinding, built-in local multiplayer, and event-driven callbacks.
- Install it from Window โธ Package Manager โธ Unity Registry.
- Active Input Handling (Player Settings) chooses the backend: Old, New, or Both; changing it restarts the Editor.
๐ What's Next?
The system is installed โ now we need something to hold your actions. In Lesson 3.2: Input Actions & Action Maps you'll create your first .inputactions asset and build a Player map with a Move (Vector2) action and a Jump (Button) action, using the visual Input Actions editor.
๐๏ธ You've retired the legacy Input class
From here on we think in Actions, not KeyCodes. Every control you build in this module works on keyboard, gamepad, and beyond โ with rebinding baked in from the start.