Edits from outside
Handle outside script changes, resolve draft conflicts, and protect your project before switching versions or accepting another tool's edits.
On this page
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.
What it does
Section titled “What it does”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.
When to use it
Section titled “When to use it”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.
What it looks like
Section titled “What it looks like”
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.
How changes are noticed
Section titled “How changes are noticed”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.
How to use it
Section titled “How to use it”Catch up with a script that changed outside Unity
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.
Edit outside Unity, then return
Make your change in the code editor and save the file. Then click back into Unity.
Open the reloaded method
Click the method’s row in the left rail if it is not already open.
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.
Rebuild the change and compile
Rebuild your change on the reloaded canvas: place and wire the nodes again, then press Compile in the toolbar.
9 stepsFull size ↗
What it writes
Section titled “What it writes”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:
Concurrent Compile protection
Section titled “Concurrent Compile protection”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
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| The canvas still shows the old method | Look 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 changed | Someone 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 moment | Renames arrive as a delete and a create. | Wait for the 150 ms batch and the reload that follows, then open it again. |



