- Home /
Referenced script missing
So I've been adjusting some script references (One only, really), and now I'm getting this error: "The referenced script on this behaviour is missing!" And the only explanation when clicking it, is: "Assert in file: /Applications/buildAgent/work/f724c1acfee760b6/Runtime/Mono/MonoBehaviour.ccp at line: 1667." Double clicking the error leads me nowhere. What should I do?
Seems like these are beco$$anonymous$$g more frequent... Like, internal builds missing key scripts... I'd say try a reinstall... $$anonymous$$ight work? I really don't know...
It sounds to me like you did the same thing my studio (initially) did and you're using and sharing prefabs across multiple computers. While this seems like an elegant solution, it's really not. When you copy over your shared code, objects, and textures, make sure to also copy the (.meta) files associated with them.
We use this tool to find out all the missing script locations in our projects. It really saved us a lot of time.
Answer by Ray-Pendergraph · Mar 31, 2011 at 12:51 PM
This happens if you have a component (MonoBehaviour) that is instrumented or "hung" on a game object and that component's source file (.cs or .js) has been:
- externally moved so that Unity no longer has a handle to it.
- deleted
- externally renamed
- put into a package (MonoBehaviours cannot be in packages)
Usually if you are running the game selecting the error in the console will highlight the offending game object or you can browse through them and look for "Missing Script"... sometimes it leaves enough information there such that you can tell what was there. After you figure out what's missing, just re-add it.
This does not indicate a Unity install issue.
I wonder how much hard if unity $$anonymous$$m add more information on the missing script, ins$$anonymous$$d just save the serialized data, unity can save at least script name or something so we can based on that to resolve. We used external editor a lot and can not just goto Unity IDE and rename each file when refactoring. It's very frustrating experience ... $$anonymous$$oreover, even if user did not rename outside, after every unity crash (by an infinite loop bug or something), the references also likely to be missing... I put a comment in the feedback here, please vote, everyone : http://feedback.unity3d.com/suggestions/missing-monobehaviour-to-tell-wh
Answer by liortal · Feb 24, 2015 at 12:21 PM
There are different types of "missing script" behaviours in Unity, as already stated by Ray. We are using this custom script to help us find all missing references in our project: http://www.tallior.com/fixing-missing-references/
See the console output for all the missing script locations. This saves us a ton of time when we encounter these issues.
Your answer
![](https://koobas.hobune.stream/wayback/20220613115936im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Obfuscating DLL classes from the users 1 Answer
Accessing a variable in one script from another script? (using C#) 1 Answer
Can a script be used without a gameObject and then be attached to a gameObject? 2 Answers
How do I detect that MonoBehaviour is modified in the Editor? 2 Answers
unity script error 1 Answer