Patch editor
Build logic by connecting nodes. A patch runs as fast as code, and you can read it as code at any time.
This page is about using the editor. What each node does is in Patches.
What you are editing
A patch can belong to the whole project, to the space, to a scene or to one object.
| You opened | You are editing |
|---|---|
| Patch editor in the left rail | the current scene's patch. If it has none, the space's or the project's. |
| Edit logic in an object's Behaviors | that object's own patch |
| a patch file in Project assets | a patch you can reuse on many objects |
Show map, in the bottom-left corner, zooms out to a map of every patch in the project. Each patch is a group of nodes there. Double-click a group to open it, or right-click it and choose Go inside. Reveal how attached shows what the patch is attached to.
To make a patch you can reuse, right-click in Project assets and choose Create asset → Patch graph. Then attach it to an object: in the object's Behaviors, click Add behavior.
Undo and live collaboration work as usual.
Toolbar
The buttons sit on the edges of the canvas:
| Button | What it does |
|---|---|
| + Add node | Opens the node menu, sorted by category. Top left. |
| Patch name | Switches to another patch: Project patch, Space patch, Scene patch or Entity patch…. A level that has no patch yet is marked Create. Next to + Add node. |
| Show map | Shows the map of all patches. Bottom left. |
| Variables | A tab on the left edge. Opens the project's Variables and Events, where you add them with a name and a type. |
| Code | A tab on the right edge. Shows the generated script, read-only, with a Copy button. |
| Fit all | An arrow at the edge of the canvas. It appears when your nodes are off screen and brings them back into view. |
The tabs on the edges show up when the pointer comes close. On a touchscreen they are always there.
If some nodes cannot run, a warning appears next to the patch name. Point at the ! marks on the nodes to see why.
Code shows the exact script your graph turned into. If something does not work, reading it is often faster than following wires. It also shows whether the graph does what you expect.
Work with the graph
| Action | How |
|---|---|
| Add a node | Right-click empty canvas (the node appears under the cursor), or click + Add node. |
| Node menu | Right-click a node: copy, cut, duplicate, paste, delete. |
| Select | Click, or drag a box on empty canvas. Hold Shift to add to the selection. |
| Select all | Ctrl + A |
| Delete | Delete or Backspace |
| Copy / cut | Ctrl + C / Ctrl + X |
| Paste | Hold Ctrl + V: the nodes follow the cursor. Let go, or click, to drop them. |
| Duplicate | Ctrl + D |
| Zoom | Scroll the mouse wheel, or pinch on a trackpad. |
| Pan | Drag with the middle mouse button, or hold Space and drag. On a trackpad, drag with two fingers. On a touchscreen, drag with one finger. |
| Collapse a node | Click the chevron in its header to hide unused ports. |
Connect nodes
Drag from a port. Ports that can take the wire light up, and the others dim.
You get a menu of nodes that can take the wire. Pick one, and the new node is already connected. This is much faster than adding a node and then finding its port.
- To re-route or remove a wire, grab it near its end.
- To detach an input, grab it.
- To cancel a drag, press
Escapeor right-click.
Port types
Each port type has its own colour:
| Type | Colour | Carries |
|---|---|---|
pulse | light blue | the order in which things run |
number | blue | a number |
boolean | orange | true or false |
string | green | text |
vector | purple | three values: x, y and z |
color | pink | a colour |
object | dark blue | a reference to an object |
pulse, object, vector and boolean connect only to their own type. Number, string and
colour convert into each other freely.
- Vector ports open with a chevron into separate
x,yandzsockets. On an input, this builds a vector from parts. On an output, it splits one. - An
objectport with no wire shows a list of the scene's objects. Leave it empty to mean the object the graph is attached to. - Constant nodes, and the id fields on variable, message and global nodes, are typed straight into the node header.
Panel size
The editor opens docked at the bottom. The menu in its header changes where it sits:
- Maximize fills the whole viewport.
- Tile window to bottom docks it at the bottom again.
- Undock turns it into a floating window.
Drag its edges to resize it.
Next: UI editor — build the 2D interface over your scene.