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 /
avatar image
4
Question by LMan · Mar 07, 2015 at 04:16 PM · unity5editor-scripting

Unity 5- "no Monobehaviour scripts in the file" message

It seems Unity 5 does not like any scripts that don't derive from Monobehaviour- my editor scripts, along with any custom classes and the like, don't seem to be compiling. All of these scripts have the message- no monobehaviour scripts in the file, or their names do not match the file name. This occurs with the example project editor scripts as well. I've done a bit of searching, and re-installed Unity with the downloader, but so far I'm quite at a loss. Thanks so much for your help!

Comment
Add comment · Show 1
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 ajmetal · Mar 12, 2015 at 02:54 PM 0
Share

Having the same problem using examples from a Unity tutorial book.

2 Replies

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

Answer by LMan · Mar 15, 2015 at 12:39 AM

It would seem that I was mistaken- the message "no monobehaviour scripts in the file" does appear on all classes not inheriting from monobehaviour, but they do compile. My scriptable object came un-associated from it's custom inspector, and that made me think the scripts were not functioning. I re-generated the scriptable object and it is now functioning correctly.

Comment
Add comment · Show 7 · 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 tecbug · Nov 20, 2015 at 08:55 AM 0
Share

@L$$anonymous$$an Can you write what exactly you did (please step by step - I'm beginner).

I have similar problem but for every script in my project (even new ones): http://i.imgur.com/ohrtJIe.png

avatar image LMan · Nov 25, 2015 at 12:03 AM 0
Share

@tecbug - I'm afraid you have a different problem than I did. Unity was behaving as it should for me- I just misunderstood what was going on. Your screenshot shows that Unity is not behaving as it should for you.

You might try deleting the library folder to trigger a project rebuild, or re-installing Unity. $$anonymous$$ake a backup of your project folder first, of course.

avatar image tecbug · Dec 02, 2015 at 02:04 PM 0
Share

I've submitted it as a bug last week: https://fogbugz.unity3d.com/default.asp?747645_qubgoo9s9qgrshr4 But still no answer. How fast they usually respond?

avatar image meat5000 ♦ tecbug · Dec 02, 2015 at 07:28 PM 0
Share

You may not get one. Bugs need to be prioritsed and some dont even get deal with by the next release. If you are 'lucky' lots of people will have the same problem and it'll be addressed faster.

avatar image Bunny83 tecbug · Dec 02, 2015 at 08:17 PM 0
Share

Uhm, you have compiler errors in your scripts. If there are errors the compiler can't compile your scripts and therefore non of your classes will work until you fix your errors. All your scripts are compiled into a single assembly. If the compilation can't be completed due to an error nothing will work.

Did you really file a bug report about that? .....

btw, you didn't include the aaa.cs file in your project. You only included the metafile which results in another error when i was first loading your project as the editor recognises the metafile and complains that no asset with that name was found so it removed the metafile as well.

edit
Both of your errors are related to this line:

 PlayerPrefs.SetInt (IsTheGameStartedForTheFirstTime, 1);

IsTheGameStartedForTheFirstTime is a method and you pass it to the SetInt method. SetInt requires a string as first parameter. This fixed the errors:

 PlayerPrefs.SetInt ("IsTheGameStartedForTheFirstTime", 1);

Next time you might want to check your errors first and if you can't solve the errors, feel free to post a question in the help room.

avatar image tecbug · Dec 03, 2015 at 08:23 AM 0
Share

@Bunny83 I've asked for help in 3 forums and they all said that's Unity error and I should reinstall Unity (what I did - didn't help) and report this as a bug. As a newbie I did so. You're first one that really helped me on this. Thank you.

avatar image roldtree · Dec 11, 2015 at 06:23 AM 0
Share

I have the same problem! At the first time , all the scripts said " no monobehaviour scripts in the file" .Create a new script ,it happens too!Then ,I try to delete some scripts which maybe cause this error! Then this error only appears on the scripts which is not inheriting from monobehaviour. Other demos downloaded from the web also have the similar problem. This trouble me a few days ,if you get this ,please help me. I should be glad if you have the time to email me (shuguang_4316@163.com),thanks a lot .by the way , my English is very poor! :)

avatar image
0

Answer by Ignorant · Jul 08, 2016 at 12:32 AM

Happen to me as well. It was super annoying. The fix was weird as hell. I had a help class at the top of the file. This help class was basically a touple with two public variables - nothing wrong with it. Except when I moved it other file all started to work again.

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

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

29 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

Related Questions

Scriptable Objects, how to force Include in Compile / Build without referencing it in the scene? 1 Answer

How can I get complete path of a sprite? 1 Answer

Filling list with editor scripts is empty on Play 1 Answer

BCE0044 erro only shows when trying to build .apk 0 Answers

Editor script variables resetting after restarting Unity 2 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