- Home /
How do I get a script to be compiled first?
I have tried the compiling hierarchy over and over but it always seem to NOT have the c# script compiling first no matter what folder it is in. Right now all non standard scripts of mine are just in the assets folder (outermost folder) and they reference a script in a standard asset folder ('mouse look' in particular). I keep getting errors I wasn't before due to 'mouselook' not compiling first like it had been for days prior to these errors.
So how do I make absolutely sure this script compiles first? I have my scripts in the same folders they were before when this worked, but I guess I need to move stuff around now for some reason.
Please describe exactly where your mouselook script is now located, and exactly what errors you are getting.
You should try to make your scripts independent of the compilation order.
mouselook is in Assets>Scripts>Standard Assets>Character Controllers>Sources>Scripts
my other scripts that I wrote are in just Assets.
The Error I get is: BCE0005: $$anonymous$$ Identifier: '$$anonymous$$ouseLook'.
I know I shouldn't rely on compilation order, but I would love to avoid having to rewrite $$anonymous$$ouseLook in UnityScript, when I know I don't have to because this all worked previously.
Answer by vicciu5 · Sep 11, 2014 at 08:40 PM
In order for a script to compile first, you need to put it in the Assets/Plugins folder. Unity Docs explains quite well this topic: http://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html
I looked at that extensively. And that's why I have the scripts placed where I say they are in my question. The issue is that it's not working when it both should be working and was working.
Your answer
![](https://koobas.hobune.stream/wayback/20220613162820im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
object reference not set to an instance of an object 3 Answers
Compiler Error: unexpected char 1 Answer
end of line error 1 Answer
Error expecting EOF found Function 0 Answers