Skip to content

Scripting concepts

Knot is Edro 3D’s visual scripting language. You create a behavior by connecting nodes in the Scripting tab. Nodes pass execution signals and values through typed slots, so the type of a value determines which inputs can receive it.

This page explains the main node categories and the value types used to connect them. For the complete list of available nodes, see the Scripting Nodes reference.

Use these concepts when you are deciding which node to add, why a connection is not accepted, or how to pass data between an event and an action. As a general rule:

  • Start a behavior with an event.
  • Use statements and control flow to decide what runs and when.
  • Use expressions to calculate the values those nodes need.

Events are entry points into a graph. They begin execution when something happens, such as when the scene starts, a visitor clicks an entity, or a scene variable changes. An event can provide values related to what happened, such as the changed variable’s value or the time since the previous frame.

Every independent behavior should begin with an event. See the Event nodes reference for the available events.

Statements perform an action or change something in the scene. Examples include setting an entity’s location, changing a material, or playing an animation. Statements usually have an execution input and output, shown as arrow-shaped slots ( ), so they can be ordered after an event or another statement.

Statements can also have value inputs. For example, a statement that changes an entity’s location needs an Entity and a Vector3 value.

Expressions calculate or provide values without changing the scene. They are also called pure functions in some contexts. Examples include adding numbers, comparing values, constructing a Vector3, and reading an entity’s properties.

Expressions are evaluated when a connected node needs their output. Connect their round value outputs ( ) to compatible value inputs on other nodes.

Control flow nodes decide the order and conditions in which statements execute. Use them to branch with an If, run multiple branches with a Sequence, repeat work with While or For Each, or pause with Wait.

Control flow nodes work with execution connections, and many also use values such as a Boolean condition or a Number duration. See the Control Flow nodes reference.

Value slots accept only compatible types. If two slots have different types, connect them through a conversion or construction node when one is available.

Type Description Common uses
Boolean A truth value: true or false. Conditions, visibility, toggles, and comparisons.
Number A numeric value, including integers and decimals. Distances, durations, factors, and scalar properties.
String Text. Labels, messages, names, and other text values.
Vector2 A pair of numbers with X and Y components. Two-dimensional positions, sizes, and coordinates.
Vector3 Three numbers with X, Y, and Z components. Three-dimensional positions, directions, and scales.
Color A color with red, green, blue, and alpha components. Materials, UI and lighting.
Rotation An orientation in 3D space. Entity orientation and rotation calculations.
Entity A reference to an entity in the uploaded scene. An entity represents a scene object (in other contexts also known as a scene node, Object3D, GameObject, Actor, etc.) Reading or changing an object’s properties, such as its location, rotation, scale, visibility/active state, etc.
Texture A reference to a texture asset. Used primarily in object materials

Vector2, Vector3, Color, and Rotation are compound values. Use their Make nodes to create a value from individual components, and their Break nodes to read those components. For example, use Make Vector3 to create a location and Break Vector3 to use its X, Y, and Z values separately.

An Entity is a reference to a scene object rather than a copy of the object’s properties. Pass the entity to an entity node, then use that node’s inputs or outputs to read or change the object.

There are two different kinds of connections in a graph:

  • Execution connections use arrow-shaped slots ( ) and determine which statements or control flow branches run next.

  • Value connections use round slots ( ) and pass typed data, such as a Boolean condition or a Vector3 location.

An execution connection does not carry a value, and a value connection does not determine execution order. A graph commonly combines both: an event starts execution, expressions calculate values, and statements use those values to change the scene.