docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Get started with the Player Input component

    Add a Player Input component to a GameObject, and choose how it notifies your scripts about input.

    Set up a Player Input component

    To set up a Player Input component:

    1. Add a Player Input component to a GameObject. This is usually the GameObject that represents the player in your game. For more information, refer to how to add components to GameObjects.

    2. Assign your action asset to the Actions field.

      If you assign the default project-wide action asset, named InputSystem_Actions, the Inspector window displays a warning. The Input System enables all the action maps in the project-wide asset by default, so more maps are active than the one that the Player Input component uses. When you assign the project-wide asset, disable the action maps that the Player Input component doesn't use in Start(). If a UI Input Module also uses the project-wide asset, keep its UI action map enabled.

    3. In Default Map, select the action map for gameplay, such as Player. The component enables this map and switches away from it when you call SwitchCurrentActionMap.

    4. In Behavior, select how the component notifies your scripts when actions are triggered.

      The behavior you select determines how you implement the methods that respond to your actions. For more information, refer to Select a notification behavior.

      The Behavior setting of the Player Input component in the Inspector window

    Additional resources

    • About the Player Input component
    • The Player Input component
    • Debug the Player Input component
    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)