docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Direct device workflow

    Follow this workflow to read device controls directly in your scripts, for prototypes and single-platform projects.

    The direct device workflow is the simplest input workflow, but the least flexible. It bypasses the Input Actions Editor, so you don't get the features that come with actions, such as bindings and rebinding. Use it for a quick implementation with one type of device. To support several types of input device or several platforms, use the Actions workflow instead. To compare the workflows, refer to Input System workflows comparison.

    To read input directly from devices, complete the following task.

    Read device controls in your scripts

    To read device controls in a script:

    1. Get a reference to a device, such as the current gamepad with Gamepad.current. For instructions, refer to Read devices directly.
    2. Read the values of its controls in your Update method. For example, read the left stick with leftStick.ReadValue(), or check the right trigger with rightTrigger.wasPressedThisFrame. You can use the same approach for other device types, such as the keyboard or the mouse.

    To open a sample scene that uses this workflow:

    1. In the Package Manager window, select the Input System package.
    2. Import the Simple Demo sample.
    3. Open the SimpleDemo_UsingState scene.

    Note: This sample requires the Universal Render Pipeline (URP) package.

    Additional resources

    • Input System workflows
    • Input System workflows comparison
    • Read devices directly
    • Supported devices reference
    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)