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?

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.

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.