- Home /
Question by
gsoftwares · Jun 08, 2018 at 11:29 AM ·
timertimer countdowntimer-script
Speed up timer
I have a countdown timer that is 55.5 seconds long. I want to speed it up (without changing the value) whenever I want, so when I call a function. Is it possible? Thanks.
Comment
"speed it up" and "without changing the value" seems to be a contradiction to me. What do you mean by this?
Answer by ShadyProductions · Jun 08, 2018 at 11:44 AM
Ofcourse just manipulate by what time you're counting, by changing the timeBetweenCount float.
private int timer = 60;
private float timeBetweenCount = 1f;
private float timeInterval = 0;
void Update()
{
timeInterval += Time.deltaTime;
if (timeInterval >= timeBetweenCount)
{
timeInterval = 0;
timer--;
}
}
Your answer
Follow this Question
Related Questions
CountDownTimer Help 1 Answer
Timer Pause and Reset Issue 2 Answers
How to make reverse countdown timer in unity? 1 Answer
Reload level after timer hits 0 1 Answer
How do you make a countdown timer that will lose time if you press a button? 1 Answer