I am at my wits end…recently had a computer harddrive crash, so I had to reimport my github project…I apparently didn’t upload my meta files so I noticed a bunch of scripts needed to be fixed…no issues, I’ll just put the scripts back on the game objects etc…
Except I take a closer look and I am getting the messages:
“The associated script can not be loaded. Please fix any compile errors and assign a valid script.”
And on the script itself I also get:
“No MonoBehaviour scripts in the file, or their names do not match the file name.”
Except they absolutely do match—everything matches, this was all working without issue until the crash.
Then I notice that half of my scripts are no longer recognized by Unity at all…they are in the same place as I left them and everything was workign fine the last time I attempted to run it prior to the harddrive issue.
When I go to add new script, it only shows me a few of my scripts instead of all of them…all of the ones that are saying they can’t be recognized are not there if I try and add a component, choose script and then it gives me a list of scripts…
It has nothing to do with the script name not matching the class name, again they are all named properly and were working fine…the scripts are there but somehow unity has decided they are no longer valid…
I tried doing what I have found that worked for some in other threads—here is what I have attempted so far with no luck:
- delete all the meta files
- move scripts out of the directory and then move them back—this seems to work for a split second but then it goes back to saying the same thing
- delete the cs project files
- rebuilt the project in Visual Studio which rebuilds without issue…
- delete the library directory
I am at a loss of what to do…I try and create a new script and copy over the contents of the old script but that doesn’t work either…it still tells me the script isn’t found.
Specifically, it appears to be scripts that are using namespaces, but even if I remove the namespace it still doesn’t find it…
Please help!