Hello, I am trying to display the score for my game on the GUI, but when I use my script the score will not show up, what is wrong with my script?
static var Score = 0;
function OnGUI()
{
GUI.Label(Rect(100,100, 100, 50), Score);
}
function OnTriggerEnter (other : Collider) {
if (other.gameObject.CompareTag ("Wall")) {
Destroy (gameObject);};
if (other.gameObject.CompareTag ("Enemy")) {
Destroy (gameObject);
Destroy (other.gameObject);
Score += 100;}
;}