docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Restrict binding resolution to a specific device

    By default, actions resolve their bindings against all devices present that the Input System is aware of (that is, those listed in InputSystem.devices). For example, if there are two gamepads connected, a binding to <Gamepad>/buttonSouth picks up both gamepads and allows the action to be performed from either gamepad.

    You can override this behavior by restricting an action asset or individual action maps to a specific set of Devices. If you do this, binding resolution only takes the controls of the specified devices into account.

    To restrict an action map to just the first gamepad:

    1. Set the .devices property of the action map to an array containing a reference to the first item in the Gamepad.all array. For example:

      actionMap.devices = new[] { Gamepad.all[0] };
    Note

    The Input System's user management feature and Player Input component make use of this automatically. They set the InputActionMap.devices for each player automatically, based on the device that is paired to each user.

    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)