Get up and running with the Input System

Hi everyone,

We just created an updated 7-part video tutorial series on the Input System full of tips on how to make the most of various use cases. We cover everything you’ll need to get up and running with the Input System including:

  • Introduction to the system’s core concepts
  • Binding Input System Actions to different keys, gamepad buttons, and the mouse axis
  • Rebinding
  • How to work with UI and multiple control schemes
  • The concepts for:
    • How interactions can define when an input action is triggered (e.g., press, hold, release)
    • Processors, and how they modify or transform raw input data before it’s used (e.g., normalizing, inverting, or clamping values)

The playlist is here; keep an eye on it as we’ll be publishing all seven videos over the next week.

Note: This post and the video tutorials don’t cover beginner user steps and concepts; they assume you’re already familiar with developing projects in Unity and using either the legacy Input Manager or Input System.

Let’s start by taking a quick look at how the two systems compare and the benefits of moving to the Input System for your next project. We’ll also look at some context for the different workflows available, since our video tutorial series only focuses on two of the three.

Input Manager vs Input System

Unity’s two systems for handling user input are the older Input Manager, which is built into the Editor, and the Input System package which was first released in 2019.

While the legacy Input Manager is simple to set up for basic projects and prototypes, its set of features is limited and inflexible if you require complex input requirements for your game. The Input System was created to replace the legacy system, providing robust, flexible, and future-proof features that address the latter’s shortcomings.

With Unity 6 the Input System is now the default solution for Unity and since its introduction multiple improvements have been made. If you are using the Input Manager today, now’s a great time to consider moving to the Input System for your next project.

Here are some of pros:

  • Flexibility and broad device support:
    The Input System supports a wide range of input devices out of the box, including those for XR applications, and can be extended to support additional HID devices, which is not possible with the Input Manager.

  • Event-based input:
    Event-based input allows you to react to input when it happens rather than only check for input once per frame and take order of input events into account which is not possible with typical polling methods. Additionally you may get better performance since you do not need to poll for inputs on every frame to see if they have changed.

  • Developer workflow:
    The Input System includes a built-in Input Debugger for real-time input monitoring, along with other tools designed for more organized and flexible input management and development workflows.

The Input System also provides out-of-the-box support for complex input scenarios, such as local multiplayer setups (with multiple players using different devices).

  • Decoupling interactions from Actions
    Actions is the central concept of the input system which allows decoupling physical inputs from logical inputs. Actions allow a single in-game action to be bound to multiple physical inputs. On top of that, Action Maps and Control Schemes gives additional flexibility by allowing actions to be activated based on in-game context or to selectively use sub-sets of bindings based on device constraints, for example based on whether a device is assigned to a certain user in a local multiplayer game. It also allows you to exert more granular control with input processing via:
    • Interactions, like requiring a button to be held for a specific duration “Hold” or double-tapped “MultiTap”
    • Processors that can modify how the raw input data is interpreted, such as applying dead zones for joystick axes, scaling input values, or clamping a range of values
  • Rebinding:
    Rebinding at runtime enables players of your game to customize input bindings to their liking.

So in short, while the old Input Manager might seem simpler for basic tasks, the Input System is more robust and future-proof, designed to handle complex input requirements and offering a more scalable solution, although it will also require a steeper learning curve.

Different workflows for different needs

So what does the workflow look like? Well, since the Input System offers a lot of advantages compared to the old Input Manager, some of you also expressed that it can feel a bit daunting to use – its very flexibility requiring you to choose from a variety of possibilities how to set it up.

Our documentation explains the workflows in great detail but in order to get the most out of the video tutorials, the main take away here is that, generally speaking, there are three main workflows for handling user input.

1. The direct workflow


Example of a direct workflow overview

The first of the three options is a simplified, script-only direct workflow wherein you read the device states directly. In some ways, this workflow is equivalent to the approach of using the Input.GetKey(KeyCode.Space) in the old system:

   // Input.GetKeyDown(KeyCode.Space) equivalent  (returns true while the button is held down over multiple frames)
if (myKeyboard.spaceKey.isPressed)
{
    Debug.Log("Space key is pressed");
}

However, this simplicity has a baked-in limitation: The input trigger is hardcoded to the function it performs. This means you need to change the script if you want to change the button, or add support for other devices like a gameplay controller. That also means you miss out on a lot of the benefits and scalability of things, which is why it’s generally not recommended, and why we don’t cover it in our Input System video tutorials.

There is an additional side effect (both in Input Manager and Input System) that the code makes it dependent on the script execution order rather than reacting to input in the order the underlying input happened.

That said sometimes, such as in prototyping, there are scenarios where you just need to register for simple input and want to keep it all in script and skip configuration steps – this can be an argument for this workflow. Let us know in the comments if you would like to see some examples of this workflow and we can look into creating a dedicated article for it.

2. The Actions workflow


Example of an Actions workflow overview

The second workflow is an action-based one and the recommended approach for most scenarios (and why we prioritize it in the video series). In this approach you use the drag and drop Actions Editor window to configure sets of input actions (“Jump,” “Move,” etc.), which you can easily map to input bindings (the spacebar, controller button press, etc.). You then reference these actions in your code and read their values to integrate with your game logic.


The Input Actions editor makes it easier to set up your input by separating actions (B) into action maps (A) and being able to define bindings for each of the actions (C).

The major advantage of this workflow is that it decouples input actions and control schemes from the physical inputs (like buttons, keys, or joystick sticks). This abstraction makes it straightforward to create device-agnostic mappings that dynamically adapt to whatever input device the player is using. As a bonus, you unlock key features of the Input System like Action Maps, which let you group input actions by context, for example, separating inputs for “Gameplay,” “Menu,” and “UI” states.

Another benefit is access to Control Schemes, which allow you to define sets of devices (e.g., keyboard and mouse, Xbox controller, touchscreen) and customize mappings specifically for them. With these features, it’s easier to switch between input methods without modifying the underlying input actions, improving scalability and flexibility for multiplatform development and diverse device support.

3. Actions and PlayerInput Component workflow


Example of Actions and PlayerInput Component workflow overview

The third workflow extends the Actions workflow with the PlayerInput Component. You can check out a more thorough walkthrough in the videos 6 and 7 in the tutorial series. The PlayerInput component connects your configured input actions to C# methods in your scripts, automatically calling those methods when the user performs an action.

Instead of writing code to manually check for input, you can set up these connections either in the Inspector using an event-driven approach or directly in your C# code with events.

The PlayerInput component is also great for local multiplayer games. When combined with the PlayerInputManager, it can automatically create new player instances when input is detected on a new device. For example, in a four-player local co-op game, players can join by pressing a button on their respective controllers, and the system will handle adding them automatically. We will be covering that in our last two videos in the series.

That was a bit of a primer but hopefully good context to have if you haven’t worked much with the Input System yet. Let’s dive into the video tutorials:

Input System tutorials

More to come

:laptop: Note: To follow along with the following tutorials, download the InputSystemAssetsPack.unitypackage below:

InputSystemAssetPack.unitypackage (11.3 MB)

  1. Input Action Editor: Get an introduction to core steps and concepts like installing the Input System, Input Actions, and using the Input System Actions Editor to bind actions to various inputs, such as keys, gamepad buttons, and mouse axes. This video also explores how Interactions define when an input action is triggered (e.g., press, hold, or release) and how Processors can modify or transform raw input data before it’s used (e.g., normalizing, inverting, or clamping values).
    https://www.youtube.com/watch?v=TiTKAseu17A

  2. Input System Scripting: Dive into scripting with the Input System and learn how to control a third-person character and implement Action Map switching for a pause menu. Learn about how to write code to move and jump the third-person character using an Input System Asset, with support for both gamepad and mouse-and-keyboard inputs. Finally, see how to add a simple pause menu that will demonstrate how Action Maps can be switched dynamically to handle different input contexts.
    https://www.youtube.com/watch?v=Cd2Erk_bsRY

  3. Input System Mobile controls: In this third video in our tutorial series, we’ll show you how to add mobile touch controls to your game using Unity’s Input System. You’ll learn how to use the On-Screen Stick and On-Screen Button components to set up onscreen controls for mobile devices, enabling touch-based input for third-person character movement.
    https://www.youtube.com/watch?v=aI-r7ILNDug

  4. Input System and UI toolkit: Learn about how to integrate the Input System with UI Toolkit to navigate and interact with a series of buttons. You’ll also get pointers on how to use gamepad controls to toggle between different button collections, enabling seamless switching on and off.
    https://www.youtube.com/watch?v=GdjP5pggaHw

  5. Rebinding Input System controls: Explore in-game rebinding, a feature that lets players customize their input controls during gameplay. This tutorial also shows you how to save these custom bindings using PlayerPrefs, an easy way to ensure your settings persist between game sessions.
    https://www.youtube.com/watch?v=JfuqMaOiNPs

  6. Local Multiplayer Player Input: This tutorial focuses on setting up local multiplayer, where two or more players share the same computer and screen, but use separate controllers. We’ll dive deep into how to configure and script for the Player Input component, including its behaviors for communicating with your scripts including both Broadcast Messages and by invoking events.
    https://www.youtube.com/watch?v=7J482rkD6hQ

  7. Multiplayer Player Input Manager: This video follows up on the 6th tutorial, again focusing on input set up for local multiplayer games. You’ll learn about how to use the Player Input Manager component to enable multiple players to control different characters in a local multiplayer setup. We’ll demonstrate this with examples, including a local co-op setup, a split-screen configuration, and a two-player scenario.
    https://www.youtube.com/watch?v=6lD8Ei_eicE

More resources

Post a comment if you have any feedback to these resources, or if you’d like more content on parts of the Input System not covered here.

Thanks for reading!

24 Likes

First of all, it’s very cool that Unity is now filling in the blanks and shooting whole videos on useful and important features. Thank you)

Secondly. Can we assume that the old input system will finally be deprecated, and only one input system will remain in Unity? That would be truly wonderful.

1 Like

Nice, but can you help me with this?: Unity Player Input, Default Map can not be empty, Input System 1.14.0

1 Like

There’s a whoops in the fifth video that somebody pointed out through a different channel:

That’s creating two different lambdas, so the unsubscribe in OnDisable() won’t work. The code should be:

private void OnEnable() 
{
    m_rebindButton.Focus();
    m_rebindButton.clicked += Rebind;
}

private void OnDisable() 
{
    m_rebindButton.clicked -= Rebind;
}
11 Likes

Thanks, Baste. Yes good catch. The error has been corrected and a new updated version of the video tutorial has been uploaded.

3 Likes

I did some digging and got a response for you in the linked thread. TL;DR, it is a visual bug (still works behind the scenes) and it is being fixed.

1 Like

I’m not sure if this is only me, but the scripts in all of the prefabs seems to be missing from the package. Could you include those into the package too?

1 Like

Hi Mysterjon. For this first version of the project we only have the starter assets (not the final end files) but we are working on an updated version which includes a few more examples where the scripts will be available as well. We are hoping this will be available later in the year along a few other tutorial series in progress.

The video where you showcase rebinding is incorrect, as you are missing

string path = InputAction.bindings[0].effectivePath;
InputAction.ApplyBindingOverride(path);

call, otherwise changing the keybind and using it right after that will not work (so user must restart game, apply overrides from JSON and only then it will work) but not during that single open session.

New input system was one of the best addition to Unity so far, improving apps snappiness, code simplicity and is easy to work with. Only thing it lacks to make it perfect for me is trigger vibration. Do you have any plans of adding Xbox’ Impulse triggers and DualSense’s Adaptive triggers support? I know it could be not very straightforward, but also a nice feature to have, which can make user experience stand out if implemented correctly.

It seems the old input system is marked legacy in 6.1, did notice this in a previous version. Is the new input system to become built in and fully replace the old one at some point? What is the future?

It is already built in and can already replace the old one

In Unity 6.3, the Input System is set as the only Input System by default :slightly_smiling_face:

? It is a package not part of the root code base as the old one is.
This makes it a little messy as a replacement - probably less so than the SRPs though!

But is the old one to be removed ever?

Unity Technologies decided to divide the engine into packages and modules — to ship fixes with more freedom without a hard connection to the Unity version, allowing installation via UPM.

The Input System is a package that in Unity 6.3 “Universal 3D” template is installed by Default in via the Package Manifest file.

The “Active Input Handling” option in Player Settings is set to “Input System” for now, previously it was set to “Both”.

If so, then it will not break the default project.

I mean some packages do get moved into the core engine. UI Toolkit and Graph Toolkit are two examples, alongside Unity’s long term plan to move ECS into the core engine too.

I think if the plan is to deprecate the old input system, then I’d like to see the ‘new’ Input System moved over to being a core module too.