1.6 KiB
Create and assign a graph to an existing GameObject
You can use the empty graph creation flow to create a new graph file and assign it to an existing GameObject in your project.
For more information on other ways to create a graph file, see Creating a new graph file.
To create a new graph and assign it to an existing GameObject:
-
In the Editor's Hierarchy window, select the GameObject where you want to assign your new graph. If the Hierarchy window isn't visible, go to Window > General > Hierarchy, or press CTRL + 4 (macOS: Cmd + 4).
-
Go to Window > Visual Scripting > Visual Scripting Graph.
-
In the new Visual Scripting window, select one of the following options:
- To create a new Script Graph, open the Create new Script Graph dropdown and select on selected game object.
- To create a new State Graph, open the Create new State Graph dropdown and select on selected game object.
-
Choose a location to save your new graph file, enter a name for the graph, and select Save.
Your new graph file automatically opens in a new window.
The new graph file should look similar to the following image:
Next steps
After you create your new Script Graph, attach it to a Script Machine to use it in your application. For more information, see Attaching a graph file to a Script Machine or State Machine.

