I’m making a simple tunnel game and I have a simple scoring system. Its basically just a counter.
My GUI script works perfectly however I can’t seem to figure out how to display the results when the player dies( I call an Application.LoadLevel() on some sort of Collison or Trigger throughout the game) and then the game starts over. Here’s my script:
var r : float = 1;
var g : float = 0;
var b : float = 0;
var a : float = 1;
function Start() {
var i : int = 0;
for(i = 0; i<=4500; i++){
guiText.text = "SCORE: "+i;
var color : Color = Color (r, g, b, a);
// Adjusts material color of text r,g,b,a(alpha).
guiText.material.color = color;
yield WaitForSeconds(.05);
}
}
How do I display the score or the counter at the “time” the player dies?