Delay/Timer takes longer when framerate is lower

Hello, I’m recently setting up a high rate of fire type of weapon for my game, between each fire I set a delay about 0.05 second.
When the game running at 60+ frame rate it’s fine, but I noticed that if I limit the framerate to around 40 and lower, the fire rate is becoming noticebly longer, I assume the delay I used is taking longer?
I’ve also tried using a timer, the result feels similar.
Can someone share some hints about what’s going on here?
Many thanks!

Hey @Guesscui2018!

You’ll want to use “Set Timer By Event” (or Key, if that’s applicable) instead, and use “Get Delta Time” and plug that into your timer!

That way it should be framerate independent! :slight_smile:

Thanks very much, however I don’t really know how to inplement the get delta time into the timer… lol Could you further explain if it’s not too much to ask? :slight_smile:
I’ve heard that if you multiply a delta seconds variable(the one promoted from Event Tick) that would also get you a consistent delay, however I tested, weirdly everything runs faster at 60 fps (even the uncapped frame rate the delay seems longer), this really makes me confused and I think I need to get a detailed explaination into everything about framerate independency.

Sorry, I meant use Get World Delta Seconds and then use a multiply node to multiply that by a float value (your seconds of time). Then take that output and plug it into the “Time” slot on the timer.

What delta seconds is is REAL seconds, it adjusts based on the framerate to give you real time. :slight_smile:

Like this, but replace Camera Move Speed with your Seconds you want to wait, and then plug the output into the timer. :slight_smile:
image

1 Like

Oh ok, thanks very much again for the explantaion, I’ll get it a try!

Yeah nevermind, I found the issues in my last post… lol

Hey, no worries! You need to increase your seconds variable, most likely. Because delta seconds is time since last frame update! So my math might be wrong, but I THINK you want to multiply the actual seconds you want by 60 if 60FPS is normal. So try using 6.0 instead of 0.1 in your seconds! (It might actually be more than that)

1 Like