- Home /
Minute Timer Issue
function Awake() {
startTime = Time.time;
}
function OnGUI() {
guiTime = Time.time - startTime - pausedTime;
minutes = guiTime/60;
seconds = guiTime%60;
}
For some reason the minute timer is going up by 1 at 30 seconds and then after that it seems fine. So I tried 120 (since it stopped at 30 sec) it worked fine for the first minute but then had issue after that. Am I missing something?
For the pausedTime it's always 0 unless a pause has occurred which it then subtracts the time it was paused.
Comment
Answer by user-4554 (yahoo) · Jan 24, 2011 at 10:34 PM
var minutes : int = Mathf.Floor(guiTime / 60);
Found the answer, I'm an idiot and forgot about the rounding up once it gets above .5. Well got it.
Your answer
Follow this Question
Related Questions
pop up a canvas when the time is up 1 Answer
Timer Pause 1 Answer
How accurate is Stopwatch.ElapsedTicks? 0 Answers
Changing light intensity over time via mathf.lerp 2 Answers
How to WaitforSeconds a GuiButton ? 0 Answers