docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    On Button Input node

    Note

    The On Button Input node is an Input Manager node. For more information about how to use the Input Manager with Visual Scripting, see Capture user input in an application.

    The On Button Input node listens for a specified action on a virtual button from your Input Manager configuration. It triggers the next node connected to it after the action occurs in the application. It doesn't send or receive any other data.

    An image of the Graph window. An On Button Input node displays with its details in the Graph Inspector.

    Fuzzy finder category

    The On Button Input node is in the Events > Input category in the fuzzy finder.

    Inputs

    The On Button Input node has the following input ports:

    Name Type Description
    Name String The name of the button the node listens to for an Input event, as it appears in the Input Manager.
    Action Press State The specific press state of the button that the node listens for.
    Hold The user holds down the button.
    Down The user presses the button.
    Up The user releases the button.

    Additional node settings

    The On Button Input node has additional settings. Access these settings from the Graph Inspector:

    [!include[nodes-coroutine](./snippets/nodes-coroutine.md)]
    Name Type Description

    Outputs

    The On Button Input node has one output port:

    [!include[nodes-input-output-trigger](./snippets/input-manager/nodes-input-output-trigger.md)]
    Name Type Description

    Example graph usage

    In the following example, the On Button Input node listens for the user to press the button or key assigned to the Jump axes in the Input Manager. When the user presses the button, the On Button Input node triggers the Rigidbody Add Force node, which adds an Impulse Force to the Rigidbody's Y axis:

    An image of the Graph window. An On Button Input node uses an inline value of Jump for its Name input port. Its Action Input port is set to Down. Its Trigger output port connects to the Invoke input port on a Rigidbody Add Force node. The Rigidbody Add Force node uses an inline value of This for its Target, an inline value of 4 for its Y, and has its Mode set to Impulse.

    The Add Force node makes the Target Rigidbody lift into the air.

    An image of the Game view. Three red spheres are on top of a grey plane, with the middle sphere lifted into the air.

    Related nodes

    The following nodes are related or similar to the to the On Button Input node:

    • On Keyboard Input node
    • On Mouse Down node
    • On Mouse Drag node
    • On Mouse Enter node
    • On Mouse Exit node
    • On Mouse Input node
    • On Mouse Over node
    • On Mouse Up node
    • On Mouse Up As Button node
    In This Article
    Back to top
    Copyright © 2025 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)