Skip to content
Bit Quirky Round Trip
Visual Scripting

Search documentation

All topics and APIs

Close returns focus to Search.

What are you looking for?

Try a common topic or a C# feature.

Browse the reference instead

Esc closes · Tab reaches results · Enter opens the focused link

v1.0.0
Menu

Preview and Compile

Build on the canvas as a draft, undo before you save, then press Compile to save it into the script.

Everything you build on the canvas is a draft until you press Compile. You can place nodes, wire them, try a value, and undo; the game’s script stays exactly as it was.

Each change that affects how the game behaves is held as a draft: a new node, a new wire, a typed value, a rename, a guard, a variable’s starting value. The canvas shows the draft at once, and the Previewing your changes. panel at the top of the right rail counts it. Compile saves every draft into the project’s script in one go, then the canvas reloads from the saved script so what you see is what Unity will run.

Moving nodes or zooming the canvas never creates a draft. Neither does bending wires. These change how the canvas looks, not what the game does, so they are saved separately and never need a Compile.

Work in drafts whenever you are trying something out: wiring a new reaction to a coin pickup, tuning a jump force, testing a different order of calls. Press Compile when the canvas shows what you want the game to do, then press Play to try it.

Compile sits near the left of the top toolbar, beside the class name, and lights up gold while drafts are waiting. Hover it to see its state: Compile and save. when drafts are waiting, Nothing to save. when the canvas matches the script, and Compiling… while it saves. When a draft still needs something from you, such as a guard that is not finished, Compile turns off and its tooltip reads Fix the pending change that needs attention before compiling. Guard edits go out with the same Compile as property access and default edits.

A draft in progress

Select a screenshot to enlarge it.

The whole Round Trip window on the CheckReady method, with an entry node, a Log node and two IsTrue nodes in one row. The gold Compile button at the top left of the toolbar is highlighted with an arrow pointing at it. The just-placed IsTrue at the end of the row is highlighted too. So is the Previewing your changes. panel at the top of the right rail, with an arrow pointing at it; it reads 2 nodes aren’t in the C# yet. and has a Revert button and a Compile button.
Figure 1. Compile and the pending panel The gold Compile button sits at the top left of the toolbar. The Previewing your changes. panel at the top right shows its count line, then the Revert and Compile buttons. The draft is one placed IsTrue and the white wire into it, so the panel counts two.

Build, undo, and compile one draft, then see a refusal

  1. Make a change on the canvas

    Right-click empty canvas and place a node, wire it from the entry node’s white Exec pin, or type a new value into a pin. Here, dragging from the exec pin and picking a statement from the menu places and wires the new node in one step.

    Clip: the pointer presses on the entry node's white exec pin and drags a white wire onto empty canvas. On release a menu opens there; the pointer clicks branch, and a node lands at the drop point, already wired from the exec pin.
    RunDemo just after a Log node is dropped from the entry node's white exec pin. The Previewing your changes. panel at the top of the right rail is highlighted: it reads that 2 nodes aren't in the C# yet, with Revert and Compile buttons.
  2. Keep building

    Each further change adds to the same draft. Type a value into the new node’s message pin.

    The same Log node with a value now typed into its message pin, highlighted. The Previewing your changes. panel's count line reflects both the node and the typed value.
  3. Take a change back

    To take a change back, click the undo arrow in the toolbar or press Cmd+Z on macOS (Ctrl+Z on Windows). To throw the whole draft away at once, click Revert in the panel: the canvas goes back to what the script says.

    The Graph view toolbar with the undo arrow highlighted, beside the draft's Log node and the Previewing your changes. panel.
    After the draft was undone back to RunDemo alone, the whole window: the toolbar's redo arrow is lit, the Previewing your changes. panel's count line reads 1 node will be removed, and the panel's Revert button is highlighted with an arrow pointing at it.
  4. Press Compile

    When the canvas shows what you want, press Compile in the toolbar or in the panel. Cmd+S on macOS or Ctrl+S on Windows does the same. Then press Play to try the result.

    The instant Compile is pressed: the toolbar's Compile button and the panel's Compile button are highlighted, with the pending draft still showing.
    Mid-Compile: the right rail's count line briefly reads 1 node will be removed as the draft's pending entries clear while Compile writes them. The Log nodes themselves are unaffected, as the next capture shows.
    RunDemo reread after a real Compile: the Previewing your changes. panel is gone, the Log node and its wire are unchanged on the canvas, and the method now reads from the saved statement.
  5. Try a refusal

    Place a second Log node after the first, leave its message pin empty, and press Compile again.

    A second Log node placed and wired onto the white path, its message pin left empty and highlighted, after pressing Compile again. The panel's Compile button is highlighted. A banner names the argument that is empty and says the call cannot be written, so wire a value or type one.

A node you place and wire counts as soon as it lands, and so does each wire you draw to it, as in the picture above. It stays counted when you open another method and come back, until Compile writes it or you undo or revert it. The placed node in the picture still shows the gray dash in its Condition box, so its call cannot be written until you give it a value.

This example follows one required-HUD change in PlayerController.RefreshHud. You do not need to read C# to use the guard; the middle slide is an optional check for readers who want to inspect the generated source before saving.

From pending guard to saved source

Select a screenshot to enlarge it.

The GUARDS card shows a new required HUD check, a gold Previewing your changes banner and an automatic warning message.
Figure 2. Review the pending change The gold banner says one guarded value in one edit is not yet compiled. _hud is marked new. The selected failure action warns and skips the rest of the method; this is still a draft.
The expanded guard disclosure shows the generated early-return check under LIVE PREVIEW · NOT YET COMPILED.
Figure 3. Optionally inspect Advanced · show code The disclosure shows exactly which C# will run when the HUD is missing. LIVE PREVIEW · NOT YET COMPILED means this is generated text to review, not proof that the script has been saved.
RefreshHud after Compile has one guarded value, a collapsed _hud row using the project default, and no pending guard banner.
Figure 4. Compile, then check the reread state After Compile, RefreshHud is read back with one guarded value and _hud using the project default. The pending banner and new marker are gone. This is the saved guard, not an unsaved preview.

If you also work in C#, this is what lands in the script after that exercise: the one line whose number you changed. Here it is a call to AddScore on ScoreCounter in the Platformer sample, with 2 typed into its amount pin:

Changes that affect behavior go into the .cs file. Node positions, the view, zoom, wire bends, notes on the canvas, and folded sections go into the diagram’s own settings file instead; Round Trip never puts canvas positions into the script. After each save the canvas is rebuilt from the script, so it always matches what Unity compiles.

When it goes wrong

SymptomCheckFix
Compile stays busyLook at Unity's status bar for compiling or importing.Wait for Unity to finish; Round Trip tries again once Unity is ready.
A refusal message appearsRead what it names: a node, a pin, or a part of the method.Fix that part of the draft, undo it, or make that change in C#.
A message says some nodes could not be written and are still on the canvasRead the node names and the reason in the message. Those nodes are not in the script, even if Compile saved other parts of your change.If the reason says nothing wires them into the execution flow, wire them into the white exec route and Compile again. Otherwise remove them, or make that change in C#. Do not assume the script matches the canvas until the message is gone.
Full-size image