For a game design project, I’m trying to use delta time, which is the amount of time between the last frame and the current frame. For my setup, I’m using task.wait(), as according to the documentation, it returns the “actual amount of time elapsed” (Documentation).
That’s right, task.wait() yield time is identical to RunService.Heartbeat:Wait() and depends on the refresh rate.
Looks like you are attempting to yield for one frame inside a Stepped or RenderStepped connection, which actually works properly, but results in these confusingly small numbers.
There’s a simple explanation to it though: the function is called before Heartbeat, so the task.wait() is resumed later in the same frame.
You shouldn’t even need to ever yield before Heartbeat. If anything, the yielding can cause lag in screen drawing and other prioritised tasks.
For updating CFrames, avoid causing any delays in rendering, camera, character, and other updates using Heartbeat and the automatically provided delta time. Most base parts ought to have their CFrame updated in the physics simulation phase.