Preview and Compile
Build on the canvas as a draft, undo before you save, then press Compile to save it into the script.
On this page
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.
What it does
Section titled “What it does”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.
When to use it
Section titled “When to use it”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.
What it looks like
Section titled “What it looks like”How to use it
Section titled “How to use it”Build, undo, and compile one draft, then see a refusal
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.
6 stepsFull size ↗Keep building
Each further change adds to the same draft. Type a value into the new node’s message pin.
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.
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.
Try a refusal
Place a second Log node after the first, leave its message pin empty, and press Compile again.
A node you place is counted
Section titled “A node you place is counted”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.
Watch one guard cross the save boundary
Section titled “Watch one guard cross the save boundary”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.
What it writes
Section titled “What it writes”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
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| Compile stays busy | Look 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 appears | Read 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 canvas | Read 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. |










