Custom VisualScript nodes
Create a new script that extends and put a keyword at the top. This is needed for the script to run in the editor.
There are some functions that can be implemented to set parameters of the custom node. Only add functions that are needed, a _has_input_sequence_port
function is not necessary if it should return false
for example.
The most important part of a custom node is the _step
function. The logic of the node is defined there.
The outputs
parameter is an array where the indices represent the output port ids. It can be modified to set the values of the output ports.
start_mode
can be checked to see if it is the first time _step
is called.
is persistent each _step
call. It can be used to store information.
Example:
Using a custom node
To use the script, add a CustomNode
, select it and drag your custom node script into the script
property shown in the inspector.