- Home /
Unity says scripts don't exist...but they do...
Hello, I am not sure what happened but all the scripts in my project are not loading. Every single script has a little error message under it saying "The associated script cannot be loaded." When I delete the components and try to re-drag and drop, I get a "can't add component because it doesn't exist" error. I have checked and double checked that the names of the scripts match their classes, and I am at a loss of what to do. Can someone please help me? It was working before...
UPDATE: I think I fixed it! I was getting lots of complier errors and per suggestion I fixed them. So the scripts exist again. Thank you everyone!
Sounds like the connections of all your stuff has been broken - you need to drag n drop each script to the appropriate gameobject probably. This is tedious but beats recreating the objects, attaching the scripts and assigning all vars... so hope that helps!
EDIT oh wait maybe that is not whats happening, at least if you already tried drag n drop to each object. In this case I am not sure what happened sorry!
Do you have any compile time errors up? These errors prevent your scripts from compiling, which occasionally sends Unity haywire.
I believe this was caused by when I tried to drag and drop an asset from a different project into this one. I also editied the script. I have tried dragging and dropping, but it still says "the associated script cannot be loaded". Bored$$anonymous$$ormon I am getting compiler errors, are you saying that if I just fix them then the scripts will load normally?
Yes. Your scripts don't get compiled by Unity until you fix your compile errors. Unity generates a project behind the scenes every time you change any scripts. If you have compile errors it can't build the project meaning your new script will be missing.
Answer by BMayne · Dec 17, 2014 at 10:49 PM
Hey there,
What I would suggest is trying to delete the Library folder in the root of your project. This folder is auto generated when Unity opens if it's missing. It can lose references and deleting it can force Unity to update. (This happens a lot in 4.6)
It's in the same place as Assets, in the root of your project. (you can't view it in Unity since its on the same level).
I tried this and it didn't work...thank you for the suggestion though.
Answer by AVOlight · Dec 17, 2014 at 10:42 PM
Try start a new project and import the scripts in. I've had issues with projects getting corrupted as well.
I tried that and no luck. Thanks for the suggestion though.
Answer by RebelDragon · Mar 13, 2015 at 06:23 PM
Hey, this is a lot late, but I fixed it. It turns out that if there are any compiler errors in your script, the script won't load until you fix them. But I will keep all this in mind in case I get this error again and I don't have errors!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Help! all of a sudden all my scripts for fpv controllers come up with an error??? how do i fix this? 1 Answer
MonoDevelop Error 2 Answers
Why is my terrain all grey? 1 Answer
Photon Cloud doesn't work correctly 3 Answers