Long loading on small project? help please.

So this is my first time using unity and I’ve been working on this project for almost 3 months. It’s not big, I have maybe 30 scripts and 2 scenes. But anytime I go from mono develop to unity or I press the play button right after changing scripts unity loads for upto 30 seconds. I have a really good computer and I know this shouldn’t be happening. Can someone tell me what might be causing this. Thank You.

Every time you change a script, all scripts in the same assembly (see script compilation order) need to get recompiled. The reason your scripts need to get compiled is because both C#, UnityScript and Boo are compiled languages, not interpreted ones (actually Boo also has an interpreter). This basically leads to much faster execution time with the downside of having a compile time.

You can see whether or not your scripts are compiling on the bottom right. While compilation is taking place a little animated loading icon appears and it should say “compiling scripts”.

Even though 30 seconds is quite a long compile time, there can be some other reasons for this:

  • If you’re using UnityScript, it first needs to get translated to Boo before it gets compiled. This takes a lot of extra time, leading to a larger compile-time.
  • If you have massively inefficient code with a huge class structure, it’s quite obvious why there would be a long compile-time.