docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Quickstart Guide

    This page has a brief description of how to quickly start using the Input System. The Input System has multiple workflows which you might prefer that offer different benefits. This quickstart guide shows a workflow which suits most common scenarios.

    First, install the Input System package. For information on how to install the new Input System, refer to Install the Input System package.

    Create and assign the default project wide actions

    The Input System stores your input configuration in an action asset. When you first install the Input System package, you must create this action asset.

    To create the default action asset and assign it as project wide:

    1. Go to Edit > Project Settings > Input System Package > Input Actions.
    2. Select Create and assign a default project-wide Action Asset.

    The Input Actions Settings window

    View and edit the default input settings

    After you have created and assigned some project wide actions, you can use the Input Actions Settings window to view and edit your input configuration.

    The Input Actions Settings window The input actions settings window displaying the default actions

    You can use this window to view the Actions to find out their names, value types, and what their corresponding bindings. You can also edit, delete, or add new Actions here.

    Read more about using the Input Action Settings Window.

    The default action maps and Actions

    Action maps allow you to organize Actions into groups which represent specific situations where a set of actions make sense together.

    The Input System's default configuration comes with two action maps: "Player" and "UI". These each contain default actions that are typically useful for gameplay and user interface interactions respectively.

    The "Player" action map defines several game-related actions such as "Move", "Look", "Jump" and "Attack" actions. The "UI" action map defines several user-interface-related actions such as "Navigate", "Submit" and "Cancel".

    Each default action has bindings to several different types of Control. For example:

    • The "Move" action is bound to the "WSAD" keyboard keys and arrow keys, a gamepad stick, the primary 2D axis on an XR controller
    • The "Jump" action is bound to the space key, the "south" button on a gamepad, and the secondary button on an XR controller.

    Read values from the default Actions

    The Input System comes pre-configured with some default Actions such as "Move", "Jump", and more, which suit many common app and game scenarios. They are configured to read input most types of input controller such as Keyboard, Mouse, Gamepad, Touchscreen and XR.

    This means, in many cases, you can start scripting with the Input System without any configuration.

    This workflow uses the following steps:

    1. Add the Input System "using" statement at the top of your script.
    2. Create variables to hold the Action references.
    3. In your Start method, find and store the Action references.
    4. In your Update method, read the values from the Action references, and add your own code to respond accordingly.

    These steps are shown in the example script below:

    using UnityEngine;
    using UnityEngine.InputSystem; // 1. The Input System "using" statement
    
    /// <summary>
    /// Example script demonstrating the quick-start workflow for reading actions.
    /// </summary>
    public class Example : MonoBehaviour
    {
        // 2. These variables are to hold the Action references
        InputAction moveAction;
        InputAction jumpAction;
    
        private void Start()
        {
            // 3. Find the references to the "Move" and "Jump" actions
            moveAction = InputSystem.actions.FindAction("Move");
            jumpAction = InputSystem.actions.FindAction("Jump");
        }
    
        void Update()
        {
            // 4. Read the "Move" action value, which is a 2D vector
            // and the "Jump" action state, which is a boolean value
    
            Vector2 moveValue = moveAction.ReadValue<Vector2>();
            // your movement code here
    
            if (jumpAction.IsPressed())
            {
                // your jump code here
            }
        }
    }
    

    These actions named "Move" and "Jump" in this script work straight away with no configuration required because they match the names of some of the pre-configured defaults in the Input System package.

    You also don't need to enable these actions, because the Input System enables the actions in the project wide asset when you enter Play mode. If you use an action asset that you haven't assigned as project wide, enable its action maps before you read their actions. For more information, refer to Enable actions.

    Note
    • Different types of Action have different value types, and so have different methods to access their value, which is why you see .ReadValue<Vector2>() used to read a 2D axis, and .IsPressed() to read a button state, in the example above.

    • If you create more than one Action with same name in different action maps, you must specify the Action Map and the Action Name separated by a / character when using FindAction. For example: InputSystem.actions.FindAction("Player/Move")

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)