- Home /
Open the same project more than once on one computer
How to open the same project on one computer multiple times?
If I try it I get the message Looks like this project is already open
.
I want to test a multiplayer without having to build on every change.
Some solutions I found are custom scripts that build and run multiple instances, or duplicating the whole project folder with a different name and symlink/hardlink/shortcut Assets folder but all of this feels redundant.
Answer by Radivarig · Feb 08, 2020 at 07:12 PM
For Windows:
https://github.com/hwaet/UnityProjectCloner
UnityProjectCloner makes a separate clone project that it shares files with over hard links. The solution below won't work on Windows due to files being in use and resolving that with "closing handles" is unpractical.
For Linux:
Deleting <project>/Temp/UnityLockfile
after opening an instance makes opening another instance possible.
When modifying the scene hit save to get the changes in other project instances.
Tested with 4 instances at the same time in play mode.
Note:
After closing an instance Unity deletes the Temp folder so various errors start to show in remaining instances like on saving, to resolve you should recreate the Temp folder.
Thank you!
It's worth noting it was locked by the Unity Editor (file in use cannot be deleted), but was able to solve this using Process Explorer, using the search for UnityLockFile then click the result (it takes you to the highlighted handle in the bottom table), right click on the row that mentions /Temp/UnityLockFile and choose Close handle. You must be running as ad$$anonymous$$ and accept the warning.
Thanks for mentioning that, I've been developing on Linux where I had no issues with deleting a file.
However, now I need this on Windows and did what you suggested but I get another error this time from Unity and for a different file`Logs/AssetImportWorker0.log to Logs/AssetImportWorker0-prev.log: The process cannot access the file because it is being used by another process.`
Process Explorer
shows that this file has 6 matches and is in use by 2 processes, UnityShaderCompiler.exe
and Unity.exe
.
There are multiple concerns, first I've read that closing handles can corrupt a file, if it is the file in use I don't care but I don't know if the "handle recycling" would make the pointer Unity has point to a different file unrelated to Unity where Unity would write into and corrupt?
Second, even if that is the last file and would not cause any Unity blocker issues, it seems unpractical to close multiple handles manually every time multiplayer testing is needed.
It would be great if someone would link to or open a new feature request..
Until then I'll be using this https://github.com/hwaet/UnityProjectCloner, it uses some hard links to not have to copy whole assets folder then syncs one way to the clone.