Hello. I’m working on a game and suddenly this is the message Unity started Showing when I tried to add a new C# code made with Visual Studio into an object.
I tried resetting Unity, and when reopening the project it took much longer than usual and now all available codes give this message, even if it’s an earlier code rather than a newly-created one.
What is this and how do I fix it?
EDIT: This issue doesn’t happen in new-created projects. Did Unity somehow corrupted my project?
Ok, after looking at different suggestions which didn’t help, one thing suggested was to make sure there is not error in any of the scripts. Someone said it shows this bug when there is an unsolved error in on of the script files and you create a script new file before fix it.
I found where it was, and after removing the problematic line and resaving everything it worked. But I don’t understand why it does that and why is the message worded as it is.
If you create a new script but unity is unable to compile it because some other code has errors , it never has a compiled version of the new script and never knows that its a mono behavior script that your are trying to put on that gameobject.