- Home /
Corrupt project making Unity freeze. Now Unity won't open at all.
So, this is a two part question I suppose. Just looking for any helpful feedback.
1) Something happened in my Unity project to freeze up. It seems to be a particular file, or combination of files. One night it worked. Then the next day I opened it up and it hung indefinitely, using a decent amount of the CPU.
I am on Windows 7 running Unity 3.5.5. So I set about to create a new project and copy pieces over a few at a time. Somewhere along that process Unity began to freeze up again. It looks like it's a .js script file. That's weird though, it seems I would just get an error in the debug log.
So, I uninstalled and reinstalled Unity, and now part 2...
2) Unity will not run at all. I have restarted my computer, reinstalled Unity, excluded DEP in Windows settings. I even did a system restore to when Unity worked just a couple days ago. Nothing.
So I have taken two steps backwards and I'm completely stuck. On top of that, the game I was building is supposed to be done now, and I can't even work on it. =(
Answer by Bunny83 · Sep 20, 2012 at 10:59 PM
Some suggestions:
Remove all "ExecuteInEditMode" attributes.
Make sure you don't do anything that can "hang" in Start, Awake or the constructor of any of your classes.
That are just general suggestions since without a piece of code we can't say what you're doing in your scripts. Maybe you launch a nuclear missile somewhere in russia :D
Answer by GWJustin · Sep 21, 2012 at 08:44 PM
I've solved the corruption issue and wanted to warn anyone else of this problem. I found out I had an endless inheritance loop in my scripts: ClassA extends ClassB, and ClassB extends ClassA. Not cool, I know. Silly mistake, but it shouldn't break Unity in my opinion.
I now realize that Unity begins compiling project scripts upon starting up and it was in the loop that Unity got caught up. It used nearly all my CPU infinitely until I would hard quit the program. This seems like a bug to me. Many other editors have a timeout feature built in. If a single script executes for say 15 seconds (or however long you specify) it will break and give you a warning. That's logical. Freezing the program to me is not logical.
A helpful suggestion I have if Unity is freezing on you at start up is to check the editor log file. On Windows 7 it is located at:
C:\Users\[user]\AppData\Local\Unity\Editor
My log file had 30Mb of the following printouts:
GUIManager:.ctor() (at Assets\Scripts\Managers\GUIManager.js:16)
FullscreenGUI:.ctor() (at Assets\Scripts\GUI\FullscreenGUI.js:1)
GUIManager:.ctor() (at Assets\Scripts\Managers\GUIManager.js:16)
FullscreenGUI:.ctor() (at Assets\Scripts\GUI\FullscreenGUI.js:1)
GUIManager:.ctor() (at Assets\Scripts\Managers\GUIManager.js:16)
FullscreenGUI:.ctor() (at Assets\Scripts\GUI\FullscreenGUI.js:1)
GUIManager:.ctor() (at Assets\Scripts\Managers\GUIManager.js:16)
FullscreenGUI:.ctor() (at Assets\Scripts\GUI\FullscreenGUI.js:1)
GUIManager:.ctor() (at Assets\Scripts\Managers\GUIManager.js:16)
FullscreenGUI:.ctor() (at Assets\Scripts\GUI\FullscreenGUI.js:1)
This would have been helpful for me to solve my freezing start up issue.
Answer by Screenhog · Sep 21, 2012 at 08:58 PM
Have you tried holding "Alt" while opening Unity? That will generally bring up a window where you can choose which project to open. Choose a different project. If this works, and the new project opens, then Unity isn't corrupt, and it's just your project. (Small consolation, maybe, but at least you'll know whether or not Unity itself is broken.)
Answer by Indiegangster · Feb 07, 2013 at 07:30 PM
I dont know if this helps but I just was about to pull my hair out it crashed so I restarted my computer , so I was copying the project so I could try to edit the scripts to see if this was the error while I was copying though some how unity had renamed a folder with a bunch of character's so unity could not open this "folder" and would just crash.... look to see if there are any irregular folder name's....... and if so just shorten the folder name by renaming it.
Answer by kaedmon · Jul 10, 2013 at 07:16 PM
Bump
Unity hangs on certain project and says "compiling scripts"
Reinstalled. Good until I encountered an inability to Play the current Scene, claiming: "Cleaning up leaked objects in scene since no game object, component or manager is referencing them Texture2D has been leaked 1 times." Unity crashes after Save Scene/Project/Quit. Now (all) projects refuse to open. Hangs on "compiling scripts."
As per certain suggestions here, removed any occurrences of "ExecuteInEditMode" that were not part of Standard Assets (in a simple 3rd-party asset).
Your answer
Follow this Question
Related Questions
Unity crashes when the game starts: maybe due to a while loop 1 Answer
Unity 4.1 hangs/freezes on startup (Mac) 0 Answers
iOS game freezes at a collision after startup 1 Answer
Main Scene keeps becoming corrupted randomly. 0 Answers
Freeze a Rigidbody2D's constraints and move the object manually with translate/Movetowards 1 Answer