Desktop editor creates .tmp files instead of updating script
I have stumbled into an issue i dont have an easy fix for, i usually got around it by cloning the world, but i think there needs to be a better, more consistent solution. the issue im talking about is once in a blue moon my desktop editor starts freaking out and instead of updating the same script im making edits to, it creates .tmp files out of updated version and reverts the original file to old version. how do i fix or bypass that bug. ive tried deleting the tmp, deleting the original and saving the tmp as original file, but i want to get to the bottom of the issue.
I've run into this exact issue many times, and it's incredibly frustrating. I believe your experience is directly linked to the VScode-to-editor compilation process, and I think I know what's happening.
What I Believe is Happening:
My theory is that this .tmp file bug occurs when there's a race condition between VScode and the Horizon Worlds editor. If you save a script in VScode, the editor immediately starts compiling it. If you then make another change and save again before that initial compilation is finished, the system gets confused. It can't overwrite the script that's currently "in use," so it creates a .tmp file for your new changes and often reverts the original file back to its last known good state.
My Current Workaround:
I've developed a manual, but reliable, process to fix this when it happens:
- Don't Touch the .tmp file yet. Go back to the main Horizon Worlds editor.
- In the editor's top menu bar, go to Script > Recompile All Scripts. Wait for this process to complete fully. This ensures the editor is in a stable, non-compiling state.
- Now, go back to VScode. In the file explorer panel on the left, right-click on the .tmp file and select "Reveal in File Explorer" (or "Show in Finder" on Mac).
- Delete the .tmp dile
- Return to the Horizon editor. Add your changes, save, it should now detect the "new" script correctly and compile it successfully. If not then manually compile that single script.
It's certainly a long-winded process for 2025, and it adds significant friction to the development loop. However, it has been a consistent way for me to recover my work without losing changes. The key seems to be getting the editor back to a stable state before manipulating the files.
Hopefully, this helps you and others get un-stuck, and hopefully, the underlying sync issue can be addressed soon.