i need help in this problem. i try to make a timer in HH:MM:SS.
var Counter: int = 0;
var minutes : int = 0;
var hours : int = 0;
var seconds : int = 0;
function CalculateCounter()
{
Counter++;
while(Counter >= 3600)
{
hours++;
Counter -= 3600;
}
while(Counter >= 60)
{
minutes++;
Counter -= 60;
}
seconds=counter;
CounterTimer.guiText.text = “”+hours+“:”+minutes+“:”+seconds;
}
The problem is the counter only count for second… the minutes and hours didnt come out.