> ## 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 by ScriptableObjects

## Create a 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

First, fill in the 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" />

## Create a Node

In the Project tab, right‑click and choose `Create > Inworld > Create Node`, then choose your node type.

<Note>
  For the custom nodes used in Character Interaction (such as `FilterInput`, `FormatPrompt`, etc.), they are stored under `CharacterInteraction`.
</Note>

After you create it, rename the ScriptableObject — especially its `Node Name` under `General Configuration`.

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

## Add a node to the graph

You can drag it directly into the graph's `Nodes` list.

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

## Create an Edge

In the Project tab, right‑click and choose `Create > Inworld > Create Edge`, then choose your edge type.

Then assign the target `GraphAsset`, the source `NodeAsset`, and the target `NodeAsset` to the edge.

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

Finally, don't forget to add the created edge to the graph's `Edges` list.

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

## Create a New Custom Node/Edge Type

Without the Graph Editor, this is more involved. First, create a Unity script that inherits from `InworldNodeAsset` (or the appropriate base type for edges).

Then add the `[CreateAssetMenu]` attribute to the class so it appears in the Create menu.

## Configure Start/End Nodes

Although this step is handled automatically by the Graph Editor, it is required when creating a graph via ScriptableObjects.

Drag the corresponding `NodeAsset` into the `Start/End Node` fields on the `GraphAsset`.

### About End Node and End Nodes

We provide both `End Node` and `End Nodes` fields. The only difference is that `End Nodes` supports multiple end nodes.

If you have only one end node, you can use either field.

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

## Validate with Graph Editor

At any time, you can open the Graph Editor to review your graph.

Any edits you make directly in the GraphAsset will immediately be reflected in the Graph Editor.

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