- Home /
time.deltaTime timer increasing faster and faster
Hey, I'm trying to make a timer that increases the longer the user looks at the same point for extended amounts of time.
Only problem is that this code here:
IEnumerator increaseInsanity()
{
while (isInside)
{
VariableHandler.timeSpentStaring += (Time.deltaTime / 60) / 4;
yield return null;
}
}
Increases slowly over time but then gets faster and faster.
For example when the timer reaches 100 it takes 30 seconds but then when it reaches 200 it takes 12 seconds Etc...
Is there anyway that I can fix this or will I just have to put up with it?
Answer by Hawaii_Dev · May 17 at 08:21 AM
Make sure you only have one of these coroutines running as more of these running will increase the speed. If that doesn't work Debug.Log(time.deltaTime) and make sure that isn't changing to much.
Cheers man, had got the answer 2 hours ago, but at least you'll be the reason why someone fixes this in the future
Have a good one
Your answer
![](https://koobas.hobune.stream/wayback/20220613060644im_/https://answers.unity.com/themes/thub/images/avi.jpg)