Heartbeat fires 30 times a second constantly on both server and client. RenderStepped fires every time a frame is rendered on the client. The max FPS is 60, so the RenderStepped fires ~60 times a second unless the player has poor performance. If they get 15 FPS, it fires 15 times a second.
Edit: also, if the player uses a FPS unlocker, it can fire MUCH faster. I’ve unlocked and fired 600 times/sec before on a medium-end PC at the time.
yes thats true but its easier to think of it like everyother frame because roblox caps and trys to stay at 60 fps so thats how games are designed lower performance is unintended, if that makes sense
That depends on how fast you want to fire the loop. Heartbeat fires every 0.033 seconds. If you’re doing complex stuff faster than that, you are begging for poor performance.
As Heartbeat fires every frame, it runs on a variable frequency . This means the rate will vary depending on the performance of the machine. If the game is running at 40 FPS, then Heartbeat will fire 40 times per second and the step argument will be roughly 1/40th of a second.
i read this on roblox dev wiki it’s still connected to the players machine / fps
RenderStepped fires before each frame is rendered.
Stepped fires after rendering, before the next physics step.
Heartbeat fires after the physics step, so you can safely use the rest of the frame time without delaying rendering or physics by using this.
They are all tied to framerate as they occur sequentially. You can observe the behaviour on the microprofiler.
They each have an argument that gives the length of time since the last frame, allowing you to account for the variable frequency if using it for something time-dependent like moving a vehicle at constant speed.
To check out the sequential order, as well as other tasks scheduled each frame that you should be aware of, visit Task Scheduler