- Home /
Unity was freezing, and now it won't open because of this error.
I've been working on this project for the past several hours with no error, and now I'm having editor problems all over the place all of a sudden. No, I haven't tried restarting my computer yet, but I will after posting this question in frustration. Maybe someone will have an answer by the time my laptop boots back up (hopeful much?).
First things first, I'm now receiving this error message upon clicking on the Unity icon to open it up: Moving Temp/Assembly-CSharp-firstpass.dll to Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll failed: Access is denied. My button options are 'Try Again', 'Force Quit', or 'Cancel' to which Try Again does nothing (does it ever?).
Before I started getting this message, Unity would freeze up when I'd press the play button to test the changes I made in UnityScript. Honestly, the last change I made before the freezing started happening was adding a print statement inside a function that swapped out textures of a material on an instantiated Game Object. The objects are cubes and the textures are only different on once face. I wanted to add in this print statement to know it ran. If it did indeed run and I couldn't see the new texture, my next plan was to use different textures of a solid color to notice the difference (because maybe my cube was rotated the wrong way), but I didn't get a chance to test it because of it freezing.
If the computer restart doesn't work, I'll go hunt down that temporary file in the message and delete it. Oi. Frustration.
Well, after the computer restart, it stopped giving me the error message and the editor did open. However, it's back to the freezing one.
Not sure what the error was but it's working now. I removed my scripts from the objects in every scene one by one to see which one was causing the game to freeze. It only froze once, causing me to assume its the other script (I only have two scripts in two different scenes), and when I removed the problem-causing script, it didn't freeze as expected. However, I reapplied the script to the object and it didn't freeze (as not expected). I put my scripts back in place and the prefabs and whatnot, and no more errors.
Huh.
Edit: I never deleted that file that I said I was going to because the error stopped showing up after I restarted my laptop.
Answer by Zikku · Sep 25, 2012 at 06:43 PM
This is just how my life always is; by the time I decide to finally post my problem after researching for existing solutions, I end up solving it myself shortly after - always making me look like an idiot. For anyone else that came across this issue, these are the steps I took to solve this error.
Shut Off computer (not restart).
Turn on computer.
Open Unity Editor (and your project, if not already)
Remove all scripts (or maybe just the ones you suspect to be causing problems) from objects in each scene.
Save and then test game to see if editor does not freeze from any script's removal.
If it doesn't freeze, save, and start to add the removed scripts back to the objects in each scene.
Just in case, save and test between each addition.
Hopefully it didn't break and you can continue working.
Answer by dale_hubub · Jun 22, 2016 at 08:35 PM
If you close Unity, delete the entire Library/ScriptAssemblies directory, it is regenerated the next time you start Unity with that project. It is some sort of permissions error that can appear when Unity crashes.
Your answer
Follow this Question
Related Questions
Profiler Causing Unity Editor to Freeze 0 Answers
The script is working but why when I try to change stuff in inspector the game is freezing ? 1 Answer
Unity freezes temporarily when recompiling/refreshing scripts 2 Answers
Weird editor lag on newest version after first play 1 Answer
My game freezes 2 Answers