How can I properly use delta time to avoid issues with .Heartbeat firing too quickly?

So I want to save the movement of a moving part for example, and I save the vector3 positions of this part in a table using Heartbeat. I want to then replay the movement of the part using the table, however the question is,

How can I properly utilize Delta Time so that the replay movement of the part is unaffected by a change in the game’s framerate (in the case where the client is using an FPS unlocker for example)?

thanks

1 Like

try this:

heartbeat:connect(function(deltatime)
     part.CFrame = part.CFrame * CFrame.new(deltatime*speed,0,0)
end)

the movement will always be consistent if you do this

2 Likes