Task.wait() for stepped

well Stepped runs before physics happen, so if you need to mess with the physics I recommend using Heartbeat

1 Like

API Reference says otherwise.
image

you should read the api better
this applies with the :Connect() parameters, not :Wait()

try this code and tell me if it waits 30 seconds, because it doesn’t

local RunService = game:GetService("RunService")

RunService.Heartbeat:Wait(10)
RunService.Stepped:Wait(10)
RunService.RenderStepped:Wait(10)

print("test")

Thought you said stepped because of the title of the topic, apologies.

1 Like

Let me try and clear a few things up.

  • task.wait is the replacement for wait
  • wait resumes before we process characters in the middle of the frame
  • task.wait resumes alongside heartbeat at the end of the frame
  • There is no drop in for Stepped. You should use RunService.Stepped:Wait()
3 Likes

adding on, RunService.Heartbeat:Wait() returns the amount of time passed since the last frame, while task.wait() returns the amount of time it yielded.

1 Like