Invoke() does not delay my game timer
I have problem with my timer. Invoke() should delay the GameTimer() but timer still runs at the start of the game, it just doesn't show up after the Invoke() is done. I want the timer to start after Invoke, is there a way?
public Text timerText;
private float startTime;
private bool finnish = false;
// Update is called once per frame
void Update () {
if (finnish)
return;
Invoke ("GameTimer", 2.0f);
}
void GameTimer () {
float t = Time.time - startTime;
string minutes = ((int)t / 60).ToString ();
string seconds = (t % 60).ToString ("f2");
timerText.text = minutes + ":" + seconds;
}
Comment
Your answer
Follow this Question
Related Questions
How to shake the virtual camera when time scale is 0? 0 Answers
20 minute countdown timer 2 Answers
How to start Day so it is Day 1 and not Day 0 ? 0 Answers
How do I store a time value in a variable. 1 Answer
why the Timer isn't working 0 Answers