Hello! I have problem: min and max time, i wanna Time to 600sec max and i not want minus, min to 0sex only.
Sorry my bad speak english
Hello! I have problem: min and max time, i wanna Time to 600sec max and i not want minus, min to 0sex only.
Sorry my bad speak english
I wrote a little guide on timers for someone else, so here it is for you to read, absorb and learn from :
in response to another question : Ive looked at a few different ways of making a timer but there not making any sense to me, could you help me out?
I personally have seen 2 types of timer/counter. The first is with a ‘timer’ and a maximum value.
var timer : float = 0.0;
var timerMax : float = 5.0;
function Update()
{
if ( timer > timerMax )
{
// do stuff
// reset timer
timer = 0.0;
}
// increment timer over time
timer += Time.deltaTime;
// increment timer with an integer value (like counting frames)
// timer ++; // like this, timer can be an integer (counter)
}
the other method is using Time.time itself, but it still need an increment value to work.
var timer : float = 0.0;
var timerDelay : float = 5.0;
function Update()
{
if ( Time.time > timer )
{
// do stuff
// reset timer
timer = Time.time + timerDelay;
}
}