A game about forced loneliness, made by TACStudios
1# Create a new simple Custom C# node
2
3You can create a Custom C# node to run your own custom logic in a Script Graph. For more information on Custom C# nodes, see [Custom C# nodes](vs-create-custom-node.md).
4
5To create a new simple Custom C# node:
6
71. [!include[open-project-window](./snippets/vs-open-project-window.md)]
8
92. Right-click a folder in the Project window's folder list, or anywhere in the Project window's preview pane, and go to **Create** > **C# Script**.
10
113. Enter a name, such as `MyNode`, for the new script file.
12
131. Press Enter.
14
154. [!include[open-new-external-code](./snippets/vs-open-new-external-code.md)]
16
175. In your external editor, copy and paste the following code into your C# script:
18
19 ```C#
20 using Unity.VisualScripting;
21 using UnityEngine;
22
23 public class MyNode : Unit
24 {
25 protected override void Definition() //The method to set what our node will be doing.
26 {
27 }
28 }
29 ```
30
316. [!include[save-script](./snippets/vs-save-script.md)]
32
331. [!include[return-unity](./snippets/vs-return-unity.md)]
34
357. [!include[regen-node-library](./snippets/vs-regen-node-library.md)]
36
37 > [!NOTE]
38 > If you don't regenerate your Node Library, the node won't appear in Visual Scripting's fuzzy finder.
39
408. [Open a Script Graph](vs-open-graph-edit.md) where you want to add your new node.
41
429. [!include[open-fuzzy-finder](./snippets/vs-open-fuzzy-finder.md)]
43
441. The node appears as `My Node` at the end of the fuzzy finder list. Select the node to add it to your graph.
45
46 
47
48## Next steps
49
50After you create the basic start to a node and add it to Visual Scripting's fuzzy finder, [add ports](vs-create-custom-node-add-ports.md) so your node can send and receive data.