Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

what does a stepped runservice loop do?

ive heard about this loop being special. am i wrong?

game:GetService("RunService").Stepped:Connect(function()

end

2 answers

✓ Accepted answer

Yes, I guess in a way they are "special", or, different than other loops. When this runs, it is hard to pinpoint what it does. It ignores waits and doesn't stop when there is an error; it prints it forever unless stopped.

Here is the best way for me to explain this: Roblox runs physics calculations 240 times a second (240 Hz). This event, RunService.Stepped gets fired every frame prior to the physics calculation. There are also some other events, like RunService.Heartbeat which fires every frame after the physics calculation, and RunService.RenderStepped which fires every frame prior to a frame being rendered. I hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.