[SOLVED] No MonoBehavior scripts in the file, or their names do not match the file name...
Well I think everyone knows this error, but I'll explain it anyway: So this error appears just out of nothing, just is there when starting unity and seems to appear for no reaon! It seems to be in Unity scince 5.0 or at least I got it in 5.0 my first time! There error just disappears about after a week and usually returns in like 3 weeks again then! The error message appears on top of each script in the inspector in JS aswell as in C#! I browsed in the internet to find a possible solution but everone just told it's there for no reason what I just accepted until now and allways just waited until it disappeared! What the error does: The scripts references doesn't really work anymore, because the scripts doesn't seem to be compiled anymore! Every script doesn't see any other scripts in the "Standard Assets" Folder anymore, which means I'm not able to start my game anymore, because of upcomming errors, so I'm not sure if the scripts doesn#t get compiled anymore, it was just an assumption!
I reimported the whole project, nothing changed! The error even appears on newly created scripts and deleting scripts doesn't change anything, too!
The usual answer, that my namespace on my scripts doesn't match the file names, is wrong, I checked it multiple times and well this error also appears on JS scripts where you don't really have any namespaces!
I didn't change anything on my project before the errors started!
Please help me, I'm looking forward to your replies and hope either that I did a mistake or that this annoying error gets fixed as I'm not the only one who has this problem!!
And by the way, my whole scene is mess, all fonts are changed and the size is either far too big or veeeery small, all pics have changed, are cutted, etc. :'( please help me D':
(click image links below for fullscreen pics)
I have the same problem and have not resolved , I need help ?
I have same issue, but when i return to Unity to fix it, it has magically went to nothing
Answer by dudester · Oct 09, 2015 at 07:41 PM
ah yes simple fix , what youve done is create a script with an error in it , and this error hasnt been fixed , so all scripts show this error to let you know that a script either has an error or is named wrong and in your case it seems its a script compler error simply click on the console window and click the red exclamation flag on the right so its enabled , a bunch of errors should pop up double click the error itll open monodevelop and should show the offending line of code with the error fix that and all should be well again.
[WRONG] No, not the case! The only error I've got is caused because a script I'm accesing could'nt be found, because of the other error! Well about every $$anonymous$$ute a nonsense NullReferenceError comes up which developed scince the other error.. And dude, I know how to solve regular errors, I've got enough experience in program$$anonymous$$g and unity! :D
Some pictures:
(click image links below for fullscreen pics)
ok well if you know the problem and what its caused by then why you asking ? re add the script or delete the reference to it so the error disappears .
also another note , javascript and C# dont like to communicate so when you put scripts in the standard assets folder you gotta make sure that the folder is named correctly otherwise they will not work.
[WRONG] are you kidding me? I know what the problem is and would reeeeeally like to know what its caused by! Because your gerat idea that something in my scripts is wrong, as we can see! As you can see in the pics, the scripts im referencing IS in the Standard Assets folder!! And I know how to communicate betwenn C# and JS as it worked fine before this great erroe :(
can i see the script for notification centre , cause by the looks of it you probably are not using the using namespace , hence your error , or the notification centre is in the standard assets folder , other then that im not sure . as for the null reference exception , thats to do with the ui seems you are missing some object in the ui , do this go into your project folder and delete your library folder that should force a reload of all assets and restore your project to original state , note backup all files before hand.
Ok I solved it, thank you veeeeery much! I was missing a parameter in my "PostNotification" function call! This was the reason why everything else went wrong, too! I'm very sorry that I didn't see that before as you had much work now..
Answer by fpatino86 · Aug 30, 2016 at 10:25 AM
Hello I had this Issue and I just found the solution. Probably if you guys are using a PC like me, the default scripting editor is Visual Studio. We need to make MonoDevelop as our default script editor. Go to Edit> Preferences > External Tools> Here we have the option: External Script Editor: we can select MonoDevelop (built-in) @dudester @JanVog
I'm new in scripting. I used Unity version 2018.3.6f1
If I create a new Script and attach it directly to Directional Light - I became this Error: "No $$anonymous$$onoBehavior..." - even if Visual Studio is closed. - in Go to Edit> Preferences > External Tools> in: External Script Editor: There are 4 posibilities: Open by file extension Visual Studio 2017 (Community) Visual Studio 2015 Browse...
Where and how is possible to solve error with "No $$anonymous$$onoBehavior..."?
I'm not seeing an option for "$$anonymous$$onoDevelop (built-in)" only visual studio code and visual studio community...
Answer by AlanMattano · Sep 04, 2021 at 03:45 PM
For me on Windows was working:
In Project right-click Asset and select "Reimport All"
If that doesn't work, select Edit > Preference... > External Tools > External Script Editor > and switch "Visual Studio.." to "Open by file extension" or vice-versa. Just switching was working!
Answer by mehranarbabian76 · Oct 02, 2017 at 05:10 PM
in this case my problem was my system language (change it to English)
Answer by DarthHawk13 · Jan 20, 2020 at 12:21 PM
I had a similar problem today. First Comodo Internet Security Premium had a total fit after i updated to Unity 2019. I was locked out of all admin privileges and denied write/read access to everything. Took a few hours just to clean Comodo off my computer. Then Unity would always give me this:
Tried all the fixes in this thread, except for the registry. I couldn't open the console window in the Unity editor because it would never show up. I changed to a different layout and it came back. Found the error message and fixed the compiler error and everything is working again.
I'm thinking Comodo is naughty and refuses to play nice with the newest version of Unity.