Runservice: Stepped and Heartbeat

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to understand the purpose of .Stepped and Heartbeat. Basically the runservice events and why it is best to run some code at a specific part of the frame.

  1. What is the issue? Include screenshots / videos if possible!

I have been looking at what the task scheduler, specifically what RunService events offer.
I understand BindToRenderStep and RenderStepped well. It’s just Heartbeat and .Stepped that don’t make sense to me. I see it used a lot, but what is an advantage that they offer? Like what does running an iteration at the end of the task scheduler process (for heartbeat) offer? Or running code right before physics simulation offer? Please give me some examples to help me understand.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yes, I have looked around a bit, but I’d like an custom explanation.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

If you are doing something complex like vector force / impulse spring suspensions for a vehicle then the difference between .Stepped and .Heartbeat is the difference between the chassis being stable or unstable.

1 Like

I see. So for .Stepped, itll take the information and use it right before physics. For heartbeat, if you take the information POST physic simulation and try to use it for the next frame physics when the object might have changed position, etc, then its basically using the wrong values for calculations and will mess up.

it’s the system that saves you a lot of fps difference problems like some people taking 0.00000000000000005 seconds to load in while other people take one century to load in

which if you were making a fighting game, could be very problematic

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.