In this lesson, you will learn how to install and configure Unity’s modern Input System package to replace the legacy input manager.
Installing the Package
Unity’s modern Input System is a separate package designed to handle complex input configurations, such as gamepad remapping or multi-device support, more effectively than the standard Input.GetAxis calls.
- Open your project in Unity.
- Navigate to Window > Package Manager.
- Set the "Packages" dropdown to Unity Registry.
- Search for Input System and click Install.
Once installed, Unity will prompt you to restart the editor. This is necessary because the package needs to integrate into the engine's core event loop.
Configuring Project Settings
After restarting, Unity may ask if you want to switch the "Active Input Handling" to the new system. If you missed this prompt or need to change it manually:
- Go to Edit > Project Settings.
- Select the Player category on the left.
- Look under the Other Settings section for Active Input Handling.
- Set this to Input System Package (New). If you want to support both legacy and modern inputs simultaneously, you can select Both.
- Restart the editor again to apply the changes.
Why the Switch?
The old input system relied heavily on polling—meaning your scripts had to ask the engine "Is the button pressed?" every single frame. This consumes CPU cycles unnecessarily. The new system is event-driven; it uses "Actions" that trigger specific pieces of code only when an input occurs.
While the old system felt like "checking a sensor," the new system feels like "waiting for a message." By configuring your project this way, you ensure that your physics-driven interactions—like moving a Rigidbody—are decoupled from the specific hardware button being pressed, making your project much easier to maintain as it grows.
Key Takeaway: Installing the Input System package and setting the Active Input Handling in Project Settings transitions your project from a frame-by-frame polling method to a more efficient, event-driven architecture.