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 nventimiglia · Jul 10, 2012 at 06:40 PM · additive

The referenced script on this Behaviour is missing!

So I have 3 scenes. Setup, Level1, and Shared. Setup and Level1 run an additive load for the Shared level on start - loading in common components.

When they do so I get a grip of 'The referenced script on this Behaviour is missing!' errors. On inspection no GameObject is identified and it points to MonoBehaviour.cpp line 1509. To make matters worse, when I run Shared on its own, I dont see this error.

Any suggestion on how I could debug this ?

Comment
Add comment · Show 4
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 nventimiglia · Jul 10, 2012 at 07:31 PM 0
Share

I created a new project, copied over all my assets.

The error has gone away. There must be a bug In the library files.

avatar image Bovine · Jul 10, 2012 at 07:38 PM 0
Share

There error would be in a scene file, did you copy those as well?

avatar image nventimiglia · Jul 10, 2012 at 07:40 PM 0
Share

Yes I did copy the scene files.

I see where your getting at (comments on answer). But I think I might have a bug from down in unitys guts.

$$anonymous$$y main concern right now is replicating the bug in a project that is south of 500mb.

avatar image marijnz · Jan 12, 2015 at 01:52 PM 0
Share

Even though it's a question from a long time ago, a while ago I made a plugin for this, "$$anonymous$$issing Script Hero": http://forum.unity3d.com/threads/released-missingscripthero-finding-missing-script-references-the-easy-way.273925/

7 Replies

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

Answer by whydoidoit · Jul 10, 2012 at 07:39 PM

You can find missing scripts using this.

Comment
Add comment · Show 4 · 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 nventimiglia · Jul 10, 2012 at 07:51 PM 0
Share

Cool script.

Searched 170 GameObjects, 608 components, found 0 missing UnityEngine.Debug:Log(Object) Find$$anonymous$$issingScripts:FindInSelected() (at Assets/Unity Commons/Editor/Find$$anonymous$$issingScripts.cs:38) Find$$anonymous$$issingScripts:OnGUI() (at Assets/Unity Commons/Editor/Find$$anonymous$$issingScripts.cs:16) UnityEditor.DockArea:OnGUI()

avatar image whydoidoit · Jul 10, 2012 at 07:52 PM 0
Share

Damn! Probably need to use @Bunny83's suggestion and try the prefabs.

avatar image Bunny83 · Jul 10, 2012 at 09:55 PM 0
Share

Hmm, if the script works, it should also work on prefabs. I'm not sure if Selection.gameObjects only returns the toplevel selection, or all childs as well, anyway i guess it's better to do a manual recursive depth search. $$anonymous$$eep in $$anonymous$$d that GetComponentsInChildren doesn't work on prefabs since it only returns active gameobjects and prefabs aren't active unless you instantiate them ;)

avatar image chelnok · Sep 05, 2013 at 08:54 PM 1
Share

very useful script.. especially Find$$anonymous$$issingScriptsRecursively version ..also prefabs can be scanned.

avatar image
3

Answer by Linus · Apr 18, 2013 at 09:50 PM

Right clicking the assets folder and selecting "Reimport All" solved it for me.

I had tried the script whydoidoit suggested, but nothing was found. I had also tried every prefab in a new scene, and looking at each object in the scene.

Unity 4.1.2

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 Mrsapo · Dec 09, 2014 at 01:29 PM 0
Share

"Reimport All" solved it for me too.

Unity 4.6.0f3

avatar image
1

Answer by Bovine · Jul 10, 2012 at 07:25 PM

Load each scene and click on the console line that's telling you that you have a missing script - the GameObject in question might not be in the scene you're editing.

Comment
Add comment · Show 6 · 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 nventimiglia · Jul 10, 2012 at 07:30 PM 0
Share

1) If I load Level1 or Setup without loading Shared (additivly) I do not get the error.

2) If I load shared by it self i do not get the error

3) If I load Shared additivly I get the error.

When I get the error no GameObject is identified, only $$anonymous$$onoBehaviour.cpp line 1509.

avatar image Bovine · Jul 10, 2012 at 07:32 PM 0
Share

I'm suggesting that having run your game in the editor, you stop the game and then in the editor load the scene for each of the levels concerned and click the console output.

Whenever I delete\lose a script and get this error, this is how I find the offending GameObjects.

Your 1, 2, 3 above suggests something else might be going on however...

avatar image Bovine · Jul 10, 2012 at 07:37 PM 0
Share

I just tried this by attaching a script to a GO and then deleting it and I see the same mono line that you do, however, provided I have, in the Unity editor, the scene loaded with the GameObject in it that has the missing script, when I click the Console line telling me about it, the offending item is highlighted for me in the hierarchy.

avatar image nventimiglia · Jul 10, 2012 at 07:38 PM 0
Share

The error only appears on play.

1) If I load Level1 or Setup without loading Shared (additivly) I do not get the error.

2) If I load shared by it self i do not get the error

3) If I load Shared additivly I get the error.

4) The error does not exist when not playing.

When I get the error no GameObject is identified, only $$anonymous$$onoBehaviour.cpp line 1509.

Simply put, I think I have a bug.

avatar image Bunny83 · Jul 10, 2012 at 07:44 PM 1
Share

It could also be on a prefab that is instantiated at runtime. So just check all assets. Create an empty scene and drag all prefabs you have into that scene and check them for missing $$anonymous$$onoBehaviours.

Generally try to avoid deleting script files and if you do, make sure they aren't used anywhere in the project. Once the script has been deleted, there's no way to deter$$anonymous$$e the name of that script or to automatically find such a broken link.

Show more comments
avatar image
0
Wiki

Answer by Aftech · Dec 12, 2013 at 01:45 PM

I had a similar issue with Unity 4.3.1f1 and finally just got rid of the warnings; I'm not entirely sure it was the same issue as nventimiglia, my case seems easier with a single scene. ( no additive loading or anything like that ). But I thought I'd share since I did use all suggestions on this thread:

In my case, after deleting old scripts, the issue was that the prefab instance was updated to not use the MonoBehavior component, but the prefab in the asset folder still had those empty MonoBehavior components. ( which is something the FindMissingScriptsRecursively script couldn't detect -- since the prefab INSTANCE was fixed/up to date )

after 45min trying to figure out where those warnings were coming from, the fix was painfully easy and obvious: press APPLY on the prefab instance to update the prefab in the assets too!

with the prefab and it's instance updated, the warnings disapeared.

I won't be forgetting the apply button anytime soon :)

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
0

Answer by YondernautsGames · Feb 21, 2016 at 12:52 PM

Just as an additional note, there is an issue with file naming here. If your behavior class name is different to the file name, it can still show up on the object in the editor without the "Missing (Mono Script)", but will still throw that missing behavior warning and I believe the component will not run. This is particularly insidious with case sensitivity, as Windows does not consider a change of case as renaming a file, so will just switch back to the original case.

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
  • ›

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

14 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

A node in a childnode? 1 Answer

Saving final score and displaying on main menu 1 Answer

null texture passed to GUI.DrawTexture 0 Answers

Get Set Errors C# 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