Skip to main content

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 openedYou are editing
Patch editor in the left railthe current scene's patch. If it has none, the space's or the project's.
Edit logic in an object's Behaviorsthat object's own patch
a patch file in Project assetsa 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:

ButtonWhat it does
+ Add nodeOpens the node menu, sorted by category. Top left.
Patch nameSwitches 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 mapShows the map of all patches. Bottom left.
VariablesA tab on the left edge. Opens the project's Variables and Events, where you add them with a name and a type.
CodeA tab on the right edge. Shows the generated script, read-only, with a Copy button.
Fit allAn 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.

Check a graph with Code

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​

ActionHow
Add a nodeRight-click empty canvas (the node appears under the cursor), or click + Add node.
Node menuRight-click a node: copy, cut, duplicate, paste, delete.
SelectClick, or drag a box on empty canvas. Hold Shift to add to the selection.
Select allCtrl + A
DeleteDelete or Backspace
Copy / cutCtrl + C / Ctrl + X
PasteHold Ctrl + V: the nodes follow the cursor. Let go, or click, to drop them.
DuplicateCtrl + D
ZoomScroll the mouse wheel, or pinch on a trackpad.
PanDrag 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 nodeClick 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.

Drop a wire on empty canvas

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 Escape or right-click.

Port types​

Each port type has its own colour:

TypeColourCarries
pulselight bluethe order in which things run
numberbluea number
booleanorangetrue or false
stringgreentext
vectorpurplethree values: x, y and z
colorpinka colour
objectdark bluea 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, y and z sockets. On an input, this builds a vector from parts. On an output, it splits one.
  • An object port 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.