docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Enabling actions

    Actions have an enabled state, meaning you can enable or disable them to suit different situations.

    Project-wide actions

    If you are using the recommended project-wide actions workflow, those actions are enabled automatically as your project starts. You do not need to enable them.

    Other actions

    For actions defined elsewhere, such as in an action asset not assigned as project-wide, or defined your own code, those actions begin in a disabled state, and you must enable them before you can use them to respond to input.

    You can enable actions individually, or as a group by enabling the Action Map which contains them.

    // Enable a single action.
    lookAction.Enable();
    
    // Enable an en entire action map.
    gameplayActions.Enable();
    

    Behaviour when enabled

    When an action is enabled, the Input System resolves its bindings, unless it has done so already, or if the set of devices that the action can use has not changed. For more details about this process, see the documentation on binding resolution.

    You can't change certain aspects of the configuration, such as an action's bindings, while an action is enabled. To stop actions or action maps from responding to input, call Disable.

    While enabled, the action actively monitors the control(s) it is bound to. If a bound control changes state, the action processes the change. If the control's change represents an interaction change, the action creates a response. All of this happens during the Input System update logic. Depending on the update mode selected in the input settings, this happens once every frame, once every fixed update, or manually if the update mode setting is set to manual.

    Overlapping bindings and action priority

    When several enabled actions share the same physical control (for example a plain B key action and a Shift+B composite), the Input System can resolve which action should respond first using either complexity-based or priority-based resolution. Both modes are configured in Project Settings > Input System Package under Improved Shortcut Support.

    Each action has a Priority property. The range is from 0 to 65535, and is clamped when set. A higher value means a higher priority, notified first.

    The Priority value applies to all bindings on that action. Serialized priority is always stored on the asset; at runtime it's used only when Action Priority Shortcut Resolution is enabled. In that case, the Priority field is also shown in the Input Actions Editor.

    When action priority resolution is active:

    • Higher priority actions are notified before lower-priority actions on the same control.
    • When an action reaches the Performed phase, priority 0 doesn't mark the input event as handled, so lower-priority actions in the same overlap group can still respond on that event.
    • Any priority greater than zero can mark the event as handled and suppress strictly lower-priority actions in the same group for that event.
    • Actions with the same priority are not suppressed relative to each other; both can perform in the same update if their bindings fire.

    To set priority in code, use .Priority:

    fireAction.Priority = 10;
    reloadAction.Priority = 5;
    

    You can also edit the Priority field on an action in the Input Actions Editor when Action Priority Shortcut Resolution is enabled.

    For information about composite shortcuts and complexity ordering, refer to Multiple input sequences (such as keyboard shortcuts).

    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)