- Home /
Erroneous "missing" script
After my computer shut down due to an unplugged cord, when I load Unity the Inspector claims that the main script is "missing" from the GameManager object even though the variables for that script are still listed (as if the correct script is still there), and it runs fine when I click on the Start button to run the game. But I can't select a script for it no matter what I try, whether by clicking on the circle next to the script's entry, nor by dragging the script over to the inspector.
I've restarted the machine, and reloaded Unity several times, but nothing works.
Anyone have any idea what's going on?
Answer by origonn · Apr 02, 2014 at 10:03 PM
I had a similar problem with a Prefab saying it was missing when it was there. Make a backup of your script, close down the Unity editor, delete your script from your project folder and start Unity back up. Then just paste your script back into the project folder and let Unity re-import it. Then re-attach it to whatever it was attached to prior.
Thank you, that worked. I got the same effect just reimporting some of the objects, so it seems that recopying or reimporting the existing files will work equally well.
Answer by haim96 · Apr 02, 2014 at 08:20 PM
close unity, make a full backup of your projecy folder. locate the script in your project folder and delete the META file with the same script name. start unity again, the meta file should be created again. you may need repeat the process for the prefab that had that script. (delete the META file with the prefab name) you may need to link the script again. hope it will help... AND DON'T FORGET TO MAKE BACKUP BEFORE!!!
I can't find any meta file, even if I do a full search of the entire directory structure. There's a subdirectory called "metadata" but all the files in it have unreadable names consisting of random letters and numbers.