- Home /
Unity freezes temporarily when recompiling/refreshing scripts
I have this annoying "problem" that whenever I edit a script, save the changes and then go back to Unity, the editor freezes for about 5 seconds. I assume it's the automatic recompiling but I don't think my computer is so bad that the whole editor should freeze. My CPU is a quad-core AMD 955 @ 3.2GHz and I have both Unity and the projects on an SSD. On other IDEs like Android Studio and Webstorm I never get any kind of freeze, could something else be the problem of it? Does anybody else experience it?
Answer by Adam-Mechtley · Jan 10, 2017 at 09:15 AM
In the editor, there is a little animated icon in the lower right that indicates it is active but compiling. Is that actually animating or is it frozen?
Sorry for not replying I didn't have access to the computer giving the problem this week, the icon spins for around 3-4 seconds and the editor responds and then freezes for 3-4 more seconds with the whole editor.
Answer by AtticusMarkane · Jan 14, 2017 at 04:59 AM
This can occur in projects with a large code-base. Obviously your computer resources effect compile time as well but even a computer with good specs can take a while to compile a large project. I am currently working on game that takes my Mac about 10-15 seconds to compile, with ~5 seconds of that time being the editor "frozen". When the editor freezes like this due to a compile you should still see the animated "compile" spinner in the bottom right corner, it is just frozen like the rest of the editor.
Something you can do to help reduce this is convert any framework code to compiled libraries (dlls). Since your code is already compiled in a dll, Unity shouldn't recompile it.
If your project isn't that big then I am not sure what else this could be.
Your answer
Follow this Question
Related Questions
Unity was freezing, and now it won't open because of this error. 3 Answers
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
Weird editor lag on newest version after first play 1 Answer
Multithreading - Freeze on Second Play 6 Answers