Scripts not Compiling

Hey everyone,

I've been trying to fix this weird problem in unity - none of the scripts are updating in the editor nor are any of them updating in the game!

The view where it shows you the script has updated, but it doesn't show a new variable if I add it. I tested this on 4 different scripts that work fine in the game engine but haven't updated to my new changes.

Such as: var test : int = 0; would normally make a little test variable appear in the unity editor, but no. it doesn't.

And yes I have tried restarting unity a few times.

Thanks in advance!

Christian S

Try commenting out everything and seeing if the editor reflects it.

Then add your script back in one function at a time. You will discover where it get hung up.

Are you double clicking on the script from within Unity to edit them? If not, you may be saving them to the wrong directory - Ive done this, though it seems contradictory with the inspector updating.

Maybe (just guessing) one of the scripts in one of the earlier passes of compilation is causing something to break. Do you have any Editor or Plugin scripts?

The inspector won't show the new variables unless the whole script is error free.

So just try what @alphasuede suggested and you'll discover your error.

Set Monodevelop as your default editor, then restart Unity.

I had the same problem, but as soon as I reopened my project it worked again.

try menu bar Assets/refresh, if this works, tick off Edit/Preferences/General/AutoRefresh.

Sometimes the editor gives the On Screen Error

“Fix compiler errors” etc etc and nothing appears in the Console Log.


Well the answer is simple.

You have a Misnamed Class file. The Filename and the Classname assigned within the file MUST match. This error can also occur with duplicated filenames.