What does it really mean if heartbeat fires after the physics simulation has completed?
This one is not really a question but rather clarification. Does render stepped fire every frame before the frame is even rendered? So I were to make a fps counter using delta time, am I better of using heartbeat instead of render stepped since it fires before the frame is even rendered while heartbeat fires every frame after physics simulation?
In my opinion, I would go for heartbeat since it fires after physics simulation.
So basically both of them run at the framerate of the game, but renderstepped is ran before rendering, whereas heartbeat runs after rendering. So with this is mind, anything that involves how the game should be rendered camera, cframing, etc, that you want to call everytime the game is rendered, should be done with renderstepped. On the contrary, any thing that you want to run every frame but doesn’t involve rendering should be run with heartbeat. If what you are doing with these functions is minor then these don’t really matter all that much, but running a lot of code in renderstepped that doesn’t affect rendering can possibly cause lag. Hope this helps :).
Anything that runs with enough speed and won’t potentially delay the rendering is good, there’s no reason to display the time every frame (unless you want, since that would be more accurate by small difference).
Here there’s no expensive operations running within so you could use either one, if you’re already running code on RenderStepped, just use the dt parameter.