Node Creation Wizard - RealityStop/Bolt.Addons.Community GitHub Wiki
The Node Creation Wizard is a Unity Editor window included with Community Addons that helps you quickly create custom Visual Scripting nodes without writing all the boilerplate code by hand.
It lets you define ports, types, and logic structure, and then generates a C# script that can be compiled into a new unit. You will still have to add the logic for your unit manually in the script.
You can open the wizard from the Unity menu:
Window → Community Addons → Node Creation Wizard
This opens a dockable editor window.
-
File Name
The name of the generated C# script and the class. Spaces will be removed automatically. -
Category
The Visual Scripting category where the node will appear in the fuzzy finder (e.g.Community/MyNodes
). -
Open Generated File
If enabled, the generated script will be opened in your default code editor after creation. -
Base Type
Select which unit type your custom node will inherit from. You can click the type selector button to choose from availableUnit
types.
The wizard lets you add and configure Control and Value ports.
- Trigger execution into your node.
- You can define a Name, an optional Method Name, and whether the port label should be hidden.
- Each control input automatically generates a method you can fill in with custom logic.
- Trigger execution out of your node.
- You can define a Name and choose to hide its label.
- Define incoming values to the node.
- Options include:
- Name
- Type (choose from the type selector)
- Hide Label
- Null Means Self (useful for component references)
- Define values your node outputs.
- Options include:
- Name
- Type (choose from the type selector)
- Hide Label
- Triggers Method (if enabled, a method stub will be generated to compute the value)
When you’re ready, click Create.
-
You’ll be asked where to save the
.cs
file. -
The wizard will generate a full C# template for your node, including:
- Port fields (
ControlInput
,ControlOutput
,ValueInput
,ValueOutput
) - A
Definition()
method that wires up the ports - Methods for control inputs and value outputs that require logic
- Port fields (
-
Unity will recompile, and the node will be available in Visual Scripting.
- Open Node Creation Wizard.
- Set File Name to
MyCustomNode
. - Set Category to
Community/Examples
. - Add:
- One Control Input (method:
Enter
) - One Control Output
- One Value Input (
float
) - One Value Output (
float
, triggers method:GetResult
)
- One Control Input (method:
- Click Create and save.
Generated class (simplified):
[UnitCategory("Community/Examples")]
[UnitTitle("MyCustomNode")]
public class MyCustomNode : Unit
{
[DoNotSerialize] public ControlInput Enter;
[DoNotSerialize] public ControlOutput Exit;
[DoNotSerialize] public ValueInput input;
[DoNotSerialize] public ValueOutput result;
protected override void Definition()
{
Enter = ControlInput(nameof(Enter), OnEnter);
Exit = ControlOutput(nameof(Exit));
input = ValueInput<float>(nameof(input), 0);
result = ValueOutput<float>(nameof(result), GetResult);
Succession(Enter, Exit);
}
public ControlOutput OnEnter(Flow flow)
{
// Custom logic
return Exit;
}
public float GetResult(Flow flow)
{
return flow.GetValue<float>(input) * 2f;
}
}