Timer wont work right!

I was making a countdown in my game for the Heist Jam, but its a big game, and the lag messed with the timing. I thought it would be a simple fix with the Deltatime Extension but it still doesn’t work.

I copied the code into the project below, please help.

The demo includes the timer and a bunch of sprites to lag the game. You can press A to clear the sprites without resetting the timer.

Thanks in advance for your help!

3 Likes

Bump. I would like to fix this before november.

AAAA the jam is about to end and I cant fix it! HELP PLEASE!!!

I completely forgot about this, Rune. Thanks for the reminder. I’ll bookmark this and look at it tonight when I get home from work.

1 Like

My immediate thought is that you should be multiplying by delta time, not dividing, though I haven’t tested anything yet.

2 Likes

I was correct in my initial guess, but also that “delta” block is very incorrect. It looks like it’s correct at first, but after the lag actually starts it becomes wildly incorrect. What you should be doing is this:


The “delta” block is taking the maximum of the delta time * 30 and 1. This is… incorrect. It means that until the lag gets bad enough that delta time * 30 is greater than 1, you’re just multiplying/dividing by 1. That’s why the timer looked correct when you were dividing, until the lag started to affect it, and it became very wrong.

2 Likes

I’m going to assume Woof Woof has solved this for you, Rune. (Thanks, bro!) If you still need help, then be sure to holler.

1 Like

YEEEAAAA

Thank you thank you thank you

My game is in your debt. (if I can finish it in time)

2 Likes