Rasagar/Library/PackageCache/com.unity.visualscripting/Documentation~/vs-input-nodes.md
2024-08-26 23:07:20 +03:00

4.0 KiB

Input Event nodes

Input nodes are an Event node type that can read input from Unity's Input Manager or Input System package for use in a Script Graph.

For more information about how to read and capture input in Visual Scripting, see Capture user input in an application.

Input System package nodes

The following nodes read and interact with Events from the Input System package:

Node Description
On Input System Event Button The On Input System Event Button node listens for a specific Input Action from a Player Input component. It doesn't send or read any other data.
On Input System Event Float The On Input System Event Float node listens for a specific Input Action from a Player Input component. The node can output a single float value.
On Input System Event Vector 2 The On Input System Event Vector 2 node listens for a specific Input Action from a Player Input component. The node can output two values as a Vector 2.

Input Manager nodes

The following nodes read and interact with Events from Unity's Input Manager:

Node Description
On Button Input The On Button Input node listens for a specified action on a virtual button from your Input Manager configuration.
On Keyboard Input The On Keyboard Input node listens for a specified action on a keyboard key.
On Mouse Down The On Mouse Down node listens for a mouse click action on a specific GameObject in your application.
On Mouse Drag The On Mouse Drag node listens for a mouse click and hold on a specific GameObject in your application. It triggers the next node connected to it as long as the mouse button is held down on that GameObject.
On Mouse Enter The On Mouse Enter node listens for the user's mouse pointer location to enter the Collider of a specified GameObject. When the mouse enters the Collider or GUI element, the node triggers the next node connected to it.
On Mouse Exit The On Mouse Exit node listens for the user's mouse pointer location to exit the Collider of a specified GameObject. When the mouse exits the Collider or GUI element, the node triggers the next node connected to it.
On Mouse Input The On Mouse Input node listens for a specific action on a user's mouse. The action doesn't need to happen on a specific GameObject's Collider.
On Mouse Over The On Mouse Over node listens for a user's mouse to land over a specified GameObject's Collider. While the user's mouse is over the Collider, it triggers the next node connected to it once every frame.
On Mouse Up As Button The On Mouse Up As Button node listens for a user to release their mouse button after they click a Collider in your application. To trigger the On Mouse Up As Button node, the user must release their mouse button over the same Collider they clicked.
On Mouse Up The On Mouse Up node listens for a user to release their mouse button after they click a Collider in your application. The user can release their mouse button anywhere in your application to trigger the On Mouse Up node.

Additional resources