Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

The referenced script on this Behaviour is missing! (One solution to this problem)

$
0
0
I am learning Unity scripting in c#, and when doing the first script tutorial, I got the error "The referenced script on this behaviour is missing!" You will get this error if the public class name in the script doesn't match the filename of the script in the project folder. I caused this error after copying and pasting the example C# code into my script, but script I created had the default name which was different than the name of the script in the video tutorial. I forgot to name the new script the same name as in the tutorial. My original script had: public class **NewBehaviourScript** : MonoBehaviour After pasting in an entire copy of the example script, I changed the class name to: public class **ExampleBehaviourScript** : MonoBehaviour Since this name doesn't match the filename of the script in my asset folder I got the reference error. I hope this helps some of the beginners like myself. It's easy to created this type of error when cutting and pasting code. If I'm wrong, please correct me on this.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>