Maze / Library /PackageCache /com.unity.visualscripting@1.8.0 /Documentation~ /vs-nesting-output-node.md
| # Output node | |
| Use an Output node to control the flow of logic and data from a Script Graph's Subgraph node. An Output node sends data from a Subgraph and makes it available to a parent graph. | |
|  | |
| For more information on Subgraphs, see [Subgraphs and State Units](vs-nesting-subgraphs-state-units.md) and [Subgraph node](vs-nesting-subgraph-node.md). For more information on Script Graphs, see [Graphs](vs-graph-types.md). | |
| ## Fuzzy finder category | |
| The Output node is in the **Nesting** category in the fuzzy finder. | |
| ## Available inputs | |
| By default, an Output node has no ports. | |
| The Output node can only have input ports. Define the number and specific data type for the input ports with the [Graph Inspector](vs-interface-overview.md#the-graph-inspector). For more information on how to define ports on a Script Graph, see [Add a Trigger or Data port to a Script Graph](vs-nesting-add-triggers-data-graph.md). | |
| | **Port Type** | **Description** | | |
| | :------------- | :-------------------- | | |
| | **Trigger Output** | A control port. Make a connection to this port to tell Visual Scripting which node triggers its exit from the Subgraph and the return to the logic in a parent graph. After the Output node runs, Visual Scripting starts any connections made to the matching Trigger Output port on the Subgraph node. | | |
| | **Data Output** | A data port. Make a connection to this port to send data from a Subgraph to its parent graph. Visual Scripting returns any value from a node connected to this port to any node connected to the matching Data Output port on the Subgraph node. | | |
| ## Example graph usage | |
| In the following example, the **Character Move** Subgraph uses an Input node to receive data from a parent graph. The Subgraph uses three values from the parent graph and the values from two Input Get Axis nodes to create a new Vector 3 value. The graph sends the new Vector 3 value to the Output node and back to the parent Script Graph. The Subgraph reduces the number of nodes in the parent graph. | |
|  | |
| The parent graph receives the Vector 3 value from the Output node. The parent graph uses that value to set a new position on the current GameObject's Transform component. | |
|  | |
| ## Related nodes | |
| Use an Output node with the following nodes: | |
| - [Subgraph node](vs-nesting-subgraph-node.md) | |
| - [Input node](vs-nesting-input-node.md) |