- Home /
Reference missing problem
hi friends i making a coin collecting game and when i done the colllectable script it shows me that error "The referenced script on this Behaviour is missing!" so any body please give me a solution and for refrence the script is given bellow. please help me to get out of it, thanx in advance
#pragma strict
function onTriggerEnter (info:Collider)
{
if (info.name == "Ball")
{
Destroy(GameObject);
}
}
Please be a bit more descriptive in your question title. "hello friends" doesn't signifies a question. You can watch the video on your right "Unity Answers tutorial video!" to learn how to ask question more effectively.
Answer by fafase · Dec 22, 2013 at 09:42 AM
A script got removed from the object. This happens when you move things around from the folder instead of doing it in the inspector.
Also your collision method won't do since it should be:
function OnTriggerEnter (info:Collider) {
if (info.name == "Ball") {
Destroy(gameObject); }
}
The method needs a cap O and gameObject a lower g on the front. The cap G means the GameObject class while the lowercase g is the gameObject you are dealing with.