I have a couple objects that are throwing errors in the warning log:

The referenced script on this Behaviour (Game Object 'myObject') is missing!

Here is what they look like in the inspector:

enter image description here

How can I see what script is (or was) associated?


You can't. Scripts in Unity are linked by unique ID, and in this case you have no script connected to that UID.

This can happen if you copied & pasted scene/script files without their associated .meta files, which are where Unity stores this UID association. These files are hidden by default, making them easy to miss when organising your project outside of Unity. When Unity sees a script file with no .meta file, it generates a new one with a new UID.

This can also happen if you're working on a shared project and have not configured your version control system to handle metadata files correctly. Each user on your project ends up with their own UIDs for new files, which don't match up to everyone else's.

If you need to investigate this forensically, try going back to the source of any files you recently imported or synched to your project, or to your last working version. Find what script is associated with that UID in this source/working version, and change the UID in your current version to match. The .meta files are plain text, so a regular text editor will do the trick here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.