playtest-unity/playtest/Library/PackageCache/com.unity.visualscripting@1.../Documentation~/vs-interface-overview.md

11 KiB

The interface

Visual Scripting's main window is the Graph window.

An image of the Visual Scripting Graph window. The Graph Inspector and Blackboard are open and a graph is visible in the other half of the window.

The Graph window has five main elements:

  • The Graph Editor, where you create, arrange, and connect nodes.
  • The fuzzy finder, which you can use to find nodes and add them to your graph.
  • The Graph toolbar, where you can change settings specific to your view in the Graph Editor and perform some common layout operations.
  • The Graph Inspector, where you can view detailed information about your nodes and configure additional settings for your graph.
  • The Blackboard, where you can define and edit variables to use in your graphs.

The Graph Editor

The Graph Editor is the center editing area of the Graph window.

An image of the Graph Editor. It displays a graph with multiple nodes and connections.

You can use the Graph Editor to create your Visual Scripting graphs. You can create nodes and connect them with edges.

You can change some default shortcuts and behaviors in the Graph Editor through your control scheme. For more information on the available control schemes in Visual Scripting, see Choose a control scheme.

The fuzzy finder

The fuzzy finder is a searchable menu that lists every node available in Visual Scripting. Right-click anywhere in the Graph Editor to open the fuzzy finder.

An image of the Graph Editor, with the fuzzy finder menu open

Search for a node by name with the Search bar, or open a category from the list to view related nodes. For example, nodes related to the creation or manipulation of variables are in the Variables category.

You can add new nodes to Visual Scripting from your own code, from other packages, or from other Unity features. For more information on how to add nodes to the fuzzy finder, see Configure project settings.

The Graph toolbar

The Graph toolbar lets you display or hide the Graph Inspector and Blackboard. The Graph toolbar also includes a breadcrumb trail for navigation through nested graphs that displays your current location. Select a graph from the trail to return to that graph file.

You can also configure some additional settings that control how nodes display in the Graph Editor.

An image of the Graph toolbar

Property Description
Lock Lock the current Script Graph or State Graph to the Graph window. Visual Scripting keeps the current graph open, even if you select another GameObject with a graph file in the Hierarchy window.
Graph Inspector Display or hide the Graph Inspector.
Blackboard Display or hide the Blackboard.
Breadcrumb Location Displays the name of the current graph. If you open a Subgraph or State Unit, or a State node inside a State Graph, use the breadcrumbs to navigate back to the parent graph.
Zoom Set a zoom level for your view of the Graph Editor.
Relations Enable Relations to display inner flow connections for Script Graph nodes. For example, on a standard Multiply node, the Relations setting draws a line from each input port that merges into a single line on the output port. The lines display the flow of data inside the node.
Disable Relations to hide these inner connections.
Values Enable Values to display the input and output values sent between nodes while the Unity Editor is in Play mode. This can make it easier to debug your scripts.
Disable Values to hide input and output values while in Play mode.
For more information on Play mode, see The Game view in the Unity User Manual.
NOTE

This setting corresponds to the Show Connection Values setting in the Preferences window for Visual Scripting. For more information on this preference, see Configure your preferences.

Dim Enable Dim to dim any nodes in the Graph Editor that aren't yet connected to the control flow in your graph. The Dim setting provides you with a visual cue that a node isn't used in the current configuration of your graph.
Disable Dim to display all nodes as active regardless of their connection state.
NOTE

This setting corresponds to the Dim Inactive Nodes setting in the Preferences window for Visual Scripting. For more information on this preference, see Configure your preferences.

Carry Enable Carry to move all connected child nodes when you move a parent node. Disable Carry to only move the currently selected node.
NOTE

This setting corresponds to the Carry Children setting in the Preferences window for Visual Scripting. For more information on this preference, see Configure your preferences.

Align Choose an alignment option to align any nodes in your current selection.
Align Left Edges Align all nodes in the selection based on their left edge.
Align Centers Align all nodes in the selection based on their vertical centers.
Align Right Edges Align all nodes in the selection based on their right edges.
Align Top Edges Align all nodes in the selection based on their top edges.
Align Middles Align all nodes in the selection based on their horizontal middles.
Align Bottom Edges Align all nodes in the selection based on their bottom edges.
Distribute Choose a distribution option to evenly distribute space between any nodes in your current selection.
Distribute Left Edges Distribute all nodes in the selection to leave an equal distance between the left edges of each node.
Distribute Centers Distribute all nodes in the selection to leave an equal distance between the vertical centers of each node.
Distribute Right Edges Distribute all nodes in the selection to leave an equal distance between the right edges of each node.
Distribute Horizontal Gaps Distribute all nodes in the selection to leave an equal-sized horizontal gap between each node. This distribution affects the space between the left and right edges of nodes.
Distribute Top Edges Distribute all nodes in the selection to leave an equal distance between the top edges of each node.
Distribute Middles Distribute all nodes in the selection to leave an equal distance between the horizontal middles of each node.
Distribute Bottom Edges Distribute all nodes in the selection to leave an equal distance between the bottom edges of each node.
Distribute Vertical Gaps Distribute all nodes in the selection to leave an equal-sized vertical gap between each node. This distribution affects the space between the top and bottom edges of nodes.
Overview Select Overview to automatically pan and zoom to fit all elements of your current graph within the Graph Editor.
Full Screen Select Full Screen when the Graph window is docked in the Unity Editor to maximize the Graph window to the full size of the Editor window.

Your Visual Scripting preferences can change some settings in the Graph toolbar or change how these settings behave. For example, you can control how fast the Graph Editor zooms in and out when you set a zoom level. For more information, see Configure your preferences.

The Graph Inspector

The Graph Inspector provides additional information about an open graph, or about any node you select in the Graph Editor.

An image of the Graph Inspector with a Switch on String node selected

If a node requires additional configuration, you can use the Graph Inspector to set these values.

To display or hide the Graph Inspector, select Graph Inspector (The Graph Inspector icon, of a grey circle with a black, lower case letter "i" in the center.) from the toolbar.

To move the Graph Inspector to the other side of the Graph window, select either Dock Right (The Dock Right button. An arrow points to the right side of a rectangle.) or Dock Left (The Dock Left button. An arrow points to the left side of a rectangle.).

The Blackboard

The Blackboard provides options to configure and manage variables in a graph. The Blackboard divides variables into five distinct scopes, across five tabs: Graph, Object, Scene, App, and Saved.

An image of the Blackboard open to the Graph variables tab

For more information on the available variable scopes in Visual Scripting, see Variables.

To display or hide the Blackboard, select Blackboard (The Blackboard icon. A letter "x" is surrounded by angled brackets.) from the toolbar.

To move the Blackboard to the other side of the Graph window, select either Dock Right (The Dock Right button. An arrow points to the right side of a rectangle.) or Dock Left (The Dock Left button. An arrow points to the left side of a rectangle.).