Hello to all!
I am new to scripting. When I try the game finished, in the menu I select play game now everything is ok, but when the game starts the clock has already started scoring 1 or 2 minutes already elapsed. I would like the stopwatch 0:0:0 departed from, when I press play on the menu, how to solve this problem?
stopwatch script I am using.
var start;
var tempoRimanente:int;
var millisecondi:int;
var secondi:int;
var minuti:int;
function Start() {
start=120; //secondi;
}
function Update () {
tempoRimanente= start = Time.time;
minuti = tempoRimanente/60;
secondi = tempoRimanente%60;
millisecondi = tempoRimanente%10;
if(tempoRimanente<0)
guiText.text="GAME OVER";
else
guiText.text= minuti.ToString("D2") + ":" + secondi.ToString("D2") + ":" % millisecondi.ToString("D2");
}