I had been making a simple endless runner type game in Unity 4. I decided to switch to 5 and when I did so, some scripts broke. I have managed to fix most of them, but the following has me stumped.
The script is attached to the pickup prefabs and handles the scoring when the player collects them. It worked in Unity 4…
The error message I get is: BCE0019: ‘Instance’ is not a member of ‘UnityEngine.GameObject’.
#pragma strict
var GameController : GameObject;
function OnTriggerEnter2D(other : Collider2D)
{
if (other.gameObject.tag == "Player")
{
dead();
GameController.Instance.SendMessage("ScoreAddTen", 10);
}
}
function dead ()
{
Destroy(gameObject);
}