0
\$\begingroup\$

One of my game objects used to have a script that I have now deleted on purpose. Now it keeps saying this message as a warning:

The referenced script on this Behaviour is missing!

How can I rid of that?

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

Remove the missing reference from your GameObject. You attached your script to something, remove the now missing component, and done.

\$\endgroup\$
3
  • \$\begingroup\$ It also happens when you rename the file and the Class somehow, that's why I actually asked. I did copy the content of the script anyway, then removed the file, and finally remaking all over again. Oh, and pasted the code of course. \$\endgroup\$
    – Fabián
    Apr 22, 2014 at 20:42
  • \$\begingroup\$ Renaming in Unity works actually, outside probably not. \$\endgroup\$
    – kat0r
    Apr 22, 2014 at 21:40
  • \$\begingroup\$ @Fabián That is because the class name and file name no longer matchup. If you change the class name to match it should work \$\endgroup\$ Jul 7, 2016 at 18:00
0
\$\begingroup\$

Another potential reason why this error might occur is that your script file name and script class name are different. For example:

Incorrect Setup

enter image description here

enter image description here

Correct Setup

enter image description here

enter image description here

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .