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?
2 Answers
2This 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.
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: Loading...
See the console output for all the missing script locations. This saves us a ton of time when we encounter these issues.
Its more likely a user error.
– StatementIt 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.
– DFortun81We use [this tool][1] to find out all the missing script locations in our projects. It really saved us a lot of time. [1]: https://www.assetstore.unity3d.com/#!/content/45693
– risingsunshine