> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Graphs with the Graph Editor

<Note>
  Everything you can do in the Graph Editor can also be achieved by creating, editing, or removing `ScriptableObject` assets.

  In highly customized scenarios, configuring via `ScriptableObjects` may offer finer control (for example, defining your own fields).

  The Graph Editor, however, is faster and requires less code.
</Note>

## Create a Graph

You still need to create a `ScriptableObject` for your graph.

In the Project tab, right‑click and choose "Create > Inworld > Graph > Default" or "Character Interaction".

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/CreateGraph01.gif?s=5e632a3117c593df0da52f2e070a407d" alt="CreateGraph" width="1920" height="1080" data-path="img/unity/framework/CreateGraph01.gif" />

## Fill in Required Fields

Do not open the Graph Editor yet.

First, fill in some required fields, otherwise the graph will not run.

The Default Graph is suitable for general tasks that are not related to character interaction.

You can also inherit from Default Graph to implement more customized functionality.

UserData is required.

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/DefaultGraph.png?fit=max&auto=format&n=09jBaDxLDhFWSIuG&q=85&s=f54f142b5d37d6919e1af49a49260443" alt="DefaultGraph" width="1221" height="834" data-path="img/unity/framework/DefaultGraph.png" />

The Character Interaction Graph inherits from Default Graph.

It is a template focused on character interaction.

In addition to UserData, it has a mandatory field: CharacterData.

If you plan to use a TTS node, also fill in the `Voice ID`.

If you plan to use an LLM node, provide a `Prompt`.

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/CreateGraph02.png?fit=max&auto=format&n=09jBaDxLDhFWSIuG&q=85&s=abd77297d92da02096257c222ac9c2fd" alt="CreateGraph02" width="1425" height="779" data-path="img/unity/framework/CreateGraph02.png" />

Once these are set, you can open the Graph Editor.

## Zoom in Zoom out and Move Graph

You can scroll the mouse wheel to zoom in and zoom out.

You can press and hold the mouse wheel to move around.

<img src="https://mintcdn.com/inworldai/4VuegDBaCnR73Uxj/img/unity/framework/Zoom.gif?s=42cf36189c93bbc5e39803a1eafe5436" alt="Zoom" width="1920" height="1080" data-path="img/unity/framework/Zoom.gif" />

## Create a Node

After opening the Graph Editor, right‑click inside the canvas and select `Create Node`.

You can add an Inworld node, or open Custom Nodes to add an existing custom node.

<img src="https://mintcdn.com/inworldai/pDD5vvrZThONehMe/img/unity/framework/OpenEditor02.gif?s=ed40fedde6b26040b5a1a25e8a404ed1" alt="OpenEditor02" width="1920" height="1080" data-path="img/unity/framework/OpenEditor02.gif" />

## Create a New Custom Node Type

While adding a node, you can also select `Create New Custom Node Script`.

A dialog will appear asking for a file name and a path.

Click `Create` to proceed.

If the IDE configured for your Unity Editor is already open, it will switch to that IDE and open the newly created file.

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/CreateNode.gif?s=c08a29a7d97d8e93791f8aaea7940bcc" alt="CreateNode" width="1920" height="1080" data-path="img/unity/framework/CreateNode.gif" />

After that, reopen the Graph Editor and you will find your new custom node under Custom Nodes.

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/CreateNode02.gif?s=85f60b63c74c359d689fbbb9253f96df" alt="CreateNode02" width="1920" height="1080" data-path="img/unity/framework/CreateNode02.gif" />

## Create an Edge

Drag from an output port of one node to an input port of another node to automatically create an edge.

<img src="https://mintcdn.com/inworldai/PEMIBdkx0YyDrDSz/img/unity/framework/CreateEdge01.gif?s=d752aa227d30a8f0f8323663c39a8166" alt="CreateEdge01" width="1920" height="1080" data-path="img/unity/framework/CreateEdge01.gif" />

You can also drag out from an output port into empty space.

The editor will open the Create Node dialog; after you select a node to create, an edge will be created automatically between the two nodes.

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/CreateEdge02.gif?s=66e06983470e6d75014554981533425a" alt="CreateEdge02" width="1920" height="1080" data-path="img/unity/framework/CreateEdge02.gif" />

## Change Edge Type

Right‑click an edge to choose its type.

<Warning>
  The editor currently only provides a set of predefined edge types.

  If you want to create your own edge type, this is not yet supported within the Graph Editor.

  Locate the corresponding `EdgeAsset` in your project and replace it with your custom ScriptableObject `EdgeAsset`.
</Warning>

<img src="https://mintcdn.com/inworldai/PEMIBdkx0YyDrDSz/img/unity/framework/ChangeEdge.gif?s=2dfa077e38e22c3f359a02ba81c0d40f" alt="ChangeEdge" width="1920" height="1080" data-path="img/unity/framework/ChangeEdge.gif" />

## Delete Nodes or Edges

Select an edge and either `Right‑click > Delete` or press the `Delete` key.

Select a node and press the `Delete` key to remove it.

<Note>
  When you delete a node, any edges that can no longer connect will also be removed.
</Note>

<img src="https://mintcdn.com/inworldai/09jBaDxLDhFWSIuG/img/unity/framework/DeleteNodeEdge.gif?s=ecb4ff6e3ff9add5b51fada2129b9eaa" alt="DeleteNodeEdge" width="1920" height="1080" data-path="img/unity/framework/DeleteNodeEdge.gif" />

## Save the Graph

Click Save Graph in the top left to save your changes to the current graph.

You can also press "Ctrl + S" to do the same.

After saving, ScriptableObjects for the nodes and edges are generated under `Assets/Data/{Your graph name}`.

The Start and End nodes are also computed and set automatically.

<img src="https://mintcdn.com/inworldai/pDD5vvrZThONehMe/img/unity/framework/SaveGraph.gif?s=0cacce763c42688f49c4877035e89bb2" alt="SaveGraph" width="1920" height="1080" data-path="img/unity/framework/SaveGraph.gif" />

## Export JSON

You can also click `Save Json` to generate a JSON representation of the graph.

<Note>
  This feature is experimental; some component settings may be incomplete and may need to be filled in manually.
</Note>
