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

Edits from outside

Handle outside script changes, resolve draft conflicts, and protect your project before switching versions or accepting another tool's edits.

Scripts change outside Round Trip: a teammate edits one in a code editor, you pull their changes, or you switch to an earlier commit. Round Trip reloads the script and checks drafts against it. Commit before either tool starts editing; these checks protect against overwriting newer work, but cannot recover an earlier version.

The canvas is always rebuilt from the script. When the script changes on disk, Round Trip notices, reloads the class, and redraws the canvas with the new nodes. A draft you started before the change was built on the old script, so Compile checks for that and refuses to save it rather than overwrite the newer work.

This matters whenever you and someone else touch the same script: a programmer adds a method in their code editor while you wire nodes, you pull a teammate’s changes, you switch branches, or a tool generates code. It also matters when you edit the script yourself in a code editor and come back to the canvas.

Code and visual scripts in one loop, on PlayerController.CollectCoin in the Platformer sample: open the method, edit its C#, create a new method visually, then Compile the draft into the file.
Code and visual scripts in one loop, on PlayerController.CollectCoin in the Platformer sample: open the method, edit its C#, create a new method visually, then Compile the draft into the file.

The loop opens on CollectCoin as Round Trip reads it from the script, redraws it after a line is added to the file outside Unity, then drafts a new method on the canvas and compiles it into the script.

Scripts inside your project’s Assets folder arrive the way Unity always imports them. Round Trip watches other registered source folders for changes, including new or deleted files and renames. It waits 150 milliseconds to collect a burst of changes before it reloads anything.

If Unity is compiling, importing, or otherwise busy, Round Trip waits and tries again after 1000 milliseconds. Clicking back into the Unity window also makes it check the scripts, which catches any change the operating system did not report.

Catch up with a script that changed outside Unity

  1. Check the right rail first

    Before you switch to a code editor, look at the top of the right rail. If the Previewing your changes. panel is showing, either click Compile to save your draft, or click the toolbar’s undo arrow (or Revert in the panel) until the panel is gone.

    The toolbar, with ReportCoin(int count)'s signature in the breadcrumb, and the floating 'Previewing your changes.' panel reading '2 nodes aren't in the C# yet.' above Revert and Compile buttons. The toolbar's Compile button, the undo arrow and the panel's buttons are highlighted.
  2. Edit outside Unity, then return

    Make your change in the code editor and save the file. Then click back into Unity.

    ReportCoin's canvas reloaded with a new Log node, "saved", between the first Log and the PlayCoin call, after a line was added to the file outside Unity.
  3. Open the reloaded method

    Click the method’s row in the left rail if it is not already open.

    ReportCoin's row in the left rail's Methods list is highlighted, beside the reloaded canvas showing all three statements.
  4. Undo a draft the file invalidated

    If you left a draft open and the script changed under it, Compile refuses with a message that the file changed. Do not try to force it through. Click Revert in the Previewing your changes. panel, or the toolbar’s undo arrow, until the draft is gone.

    The toolbar with a red banner reading 'ExternalEditsExamples.cs changed while compiling; discard and try Compile again.' above the still-open 'Previewing your changes.' panel showing Revert and Compile. The toolbar's undo arrow and the panel's buttons are highlighted.
  5. Rebuild the change and compile

    Rebuild your change on the reloaded canvas: place and wire the nodes again, then press Compile in the toolbar.

    Clip: the pointer presses PlayCoin's white exec pin and drags onto empty canvas; a menu opens, the pointer clicks Log, and a new Log node lands wired from PlayCoin's exec pin. The pointer then drags the entry node's count pin onto Log's message pin, wiring it, and presses Compile. While Compile is pressed, the toolbar's Compile button is highlighted with an arrow pointing at it.

If you also work in C#: Round Trip does not rewrite a script just because it noticed a change. It reloads the class and rebuilds the canvas from what is there. This check from CollectCoin on PlayerController in the Platformer sample, shown on its own in a SkipSpentCoin helper, stays exactly as written and appears on the canvas as an EQUALS node and an OR node feeding a yellow BRANCH whose true arm runs to a magenta EXIT node:

Right before Compile writes, Round Trip checks that the script on disk is still the one your draft started from. If it is not, the message reads:

{file} changed while compiling; discard and try Compile again.

Nothing is written. The newer script stays intact, and your draft is not quietly moved onto it. Round Trip stops here on purpose: a method with the same name can still have changed inside, so laying the old draft over it could put your nodes in the wrong place.

Round Trip normally writes a temporary file and replaces the original. If that fails, it can fall back to writing directly to the original file. This is not a guarantee against incomplete writes or damaged code; your last commit is. After saving, Unity imports the script and Round Trip reloads the class list.

When it goes wrong

SymptomCheckFix
The canvas still shows the old methodLook at Unity's status bar for compiling or importing.Wait for Unity to finish, then click into the Unity window or click the method's row again.
Compile says the file changedSomeone or something saved the script after your draft began.Undo the draft and rebuild it on the reloaded canvas.
A renamed script vanishes from the left rail for a momentRenames arrive as a delete and a create.Wait for the 150 ms batch and the reload that follows, then open it again.
Full-size image