Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
5
Question by NeatWolf · Mar 20, 2014 at 05:37 PM · errorprojectcompile

"The associated script cannot be loaded" on every Script in every GameObject in the project. Corrupted Project.

This is not really a question, this is an answer for everyone that may have this problem. (I solved this a minute ago)

It all happened when I was synchronizing my project on a remote server, and opened at the same time the same project in Unity. When I looked at the scene objects, every script on every GameObject was saying "The associated script cannot be loaded, please fix errors, etc.".

The project seemed corrupted and I thought I had lost a lot of work.

And, I had no errors, the bar at the bottom said nothing even when I tried to change a script.

Everything was fine before.

The first time I opened a script, I got some weird error about the solution being wrong.

Each time I opened the project, I get a "compiling script" progress bar, that stops in the middle, then opens the project.

If I pressed Play, it said I had to fix the errors.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

15 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by Penj · Apr 20, 2017 at 05:36 PM

This just happened to me! Crazy scare! Wow!

Here's all it is... (As what my understanding is/how I resolved my problem)

For some reason, if you have "compiler errors", the inspector will NOT load the scripts. (even though we both know they are there, and there are NO problems with them)

But... In MonoDevelop, hit "F8", and you should see some compiler errors. Fix those, then go back to the inspector, and your problem should be fixed.

At least that's what I did, and it worked fine.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dakimaru · Oct 25, 2017 at 11:39 PM 1
Share

This!!! Third time it happened to me this year and the other 2 times I wasted hours putting everything back together. This time I cleared all compile errors and all references were back to normal.

avatar image
5
Wiki

Answer by NeatWolf · Mar 20, 2014 at 05:39 PM

My solution:

Don't touch anything in the project.

In the file manager take the last 1-2 scripts you were working on, and move them out of the project folder.

Reopen the project.

The project should be working fine now.

If you drag again the files on the project (mine was a c# script), it WON'T compile again. Should be something in that script that the compiler doesn't like.

Recreate the new scripts from scratch, and add small portions of code copied from the copy you moved away, and try to isolate the lines of the code that seems to cause the issue.

Save the file each time. If you don't get any errors, may also mean the compiler has crashed. To be sure everything's working, run the project.

EDIT: for some reasons, after the crash the console disappeared - that could be the cause of the silent compilation fails.

Make sure to re-enable it from the Window menu.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
4

Answer by SaifHakeam97 · Aug 28, 2018 at 02:39 PM

the same issue just happened to me. The reason was bcz I've renamed one of the scripts(inside Unity) which were referenced in another script.Visual Studio couldn't detect the issue so just make sure that the files in Unity has the same class name in the Visual Studio.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vtohal · May 25, 2020 at 05:10 PM 0
Share

I had ran into the same problem. So, we should always be careful while rena$$anonymous$$g scripts

avatar image
3

Answer by yogurt1989 · Aug 09, 2017 at 09:05 PM

Try right click on the folder where you keep your scripts or in each individual file and click on "Reimport", as an alternative click on "Reimport All" on your assets folder but the later can take a few hours in a big project.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image unity_WPzfLehdpNGaDQ · Sep 02, 2019 at 12:04 PM 0
Share

Reimporting worked for me also.

avatar image sand7797 · Apr 20, 2020 at 08:54 AM 0
Share

I need to reimported all scripts and afterwards removed the last script i used in my project, then i dragged the script into my unity project again and all was working fine

avatar image
2

Answer by klimentievyr · May 28, 2018 at 10:53 AM

привет, столкнулся с такой же проблемой. Ошибка была в том, что файл скрипта должен соответствовать названию класса,привет, тоже столкнулся с такой проблемой. Проблема была в том, что имя скрипта в Visual Studio и в Unity отличались. пример RepairInventoryItems и RepairInventoryIteMs

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • 3
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

42 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Cannot compile .exe with specific .dll. (but with other .dlls created the same way) 0 Answers

NullReferenceException: Object reference not set to an instance of an object BotControlScript.Start () (at Assets/script/BotControlScript.cs:41) 0 Answers

I really ned help at startup 0 Answers

IndexOutOfRangeExeption: Array index is out of range 1 Answer

¿Por qué ya no puedo compilar libil2cpp?... error. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges