Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 /
avatar image
0
Question by DaiMangouDev · Jul 11, 2015 at 01:29 AM · c#assetdatabasescriptableobject

why are "The associated scripts can not be loaded" errors seemingly being thrown at random for .asset files

HI , This error seems to occur at random . Once I create the asset ,everything is fine . Sometime when there is a assembly reload I get this error and sometime I don't get the error , heck sometimes i get the error then it goes away ... same thing whenever i close and restart Unity.

Here is my code for creating this asset where Comp is the Class which inherits from ScriptableObject

  var asset = ScriptableObject.CreateInstance<Comp>();
 AssetDatabase.CreateAsset(asset,"Assets/NewFolder/Comp.asset");
                                                           
                     AssetDatabase.SaveAssets();
                     AssetDatabase.Refresh();

alt text

comp5.jpg (16.1 kB)
Comment
Add comment · Show 2
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 barbe63 · Jul 11, 2015 at 09:35 AM 2
Share

Check if the script name is the same as the Class that inherit from $$anonymous$$onoBehaviour. Reassign it to the inspector.

avatar image DaiMangouDev · Jul 11, 2015 at 12:37 PM 0
Share

The Comp class was part of another script. I created a Comp.cs script and place the comp class in there.

It seems that not having the class name be the same as the script name will cause this problem.

1 Reply

· Add your reply
  • Sort: 
avatar image
7
Best Answer

Answer by DaiMangouDev · Jul 11, 2015 at 12:38 PM

The Comp class was part of another script. I created a new Comp.cs script and place the Comp class in it.

It seems that not having the class name be the same as the script name will cause this problem.

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 Deadcow_ · Sep 01, 2015 at 11:37 AM 0
Share

Thanks a lot

avatar image theLittleSettler · Dec 27, 2017 at 08:51 AM 0
Share

still true in unity 5.6; It was happening for me predictably, every time I restarted unity

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

24 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

Related Questions

Multiple Cars not working 1 Answer

Assistance needed with serialization, inheritance and scriptableobject 1 Answer

Distribute terrain in zones 3 Answers

Custom assets give Missing (Mono Script) 0 Answers

Auto removing entries form a scriptableobject list when asset is deleted. 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