So, sorry for the bump, but one thing to note is that DeltaTime is let’s say, … weird, when a session lauinches, if you wanna not have an issue with that, you can try doing Heartbeat:Wait()
twice and seeing if that helps, before executing wait.
This was probably why you were having issues in the first place.
I recommend using DeltaTime solution opposed to using os.clock
solutions most if not all the time. Especially if you’re working with UI or anything that’s using a RunService event really, anything client wise basically.
os.clock
solutions don’t suffer from this issue but they aren’t great.
The problem is that frames don’t actually start rendering after a pretty good amount of time after the session actually starts, therefore you get these 4.5
numbers, the first frame messes up the rest.
I recommend you look into this reply for better understanding.
I actually even suspect Roblox’s wait might be doing this as well. (not task.wait
)
A normal DeltaTime based solution will pretty much always return way higher differences for much time it says it takes, and how much time it actually did than what’s seen above.
