Help with DeltaTime and CFrames

hello. i am currently stuck trying to solve a CFraming problem

i have a loop where im updating a part’s CFrame rotation like this:

part.CFrame *= offset

where offset = CFrame.Angles(math.rad(10), 0, 0)

since this is running every frame, how could i achieve framerate independance with this sort of loop?

im not able to directly multiply DeltaTime with the math.rad(10), if that was the solution

But multiplying your angle by delta time is how you are supposed to do it.

Part.CFrame *= CFrame.Angles(math.rad(10) * dt, 0, 0)

This means that your part will rotate 10 degrees per second.

Why can’t you multiply the math.rad(10) by delta time?

i feel really dumb right now :^) i found a way to implement that fix, my issue came from the fact that offset is inside a data table passed to my module function, and i was kinda too lazy to think of anything besides just passing the CFrame directly (since the caller shouldnt yield, i was scared to use math.rad(n * RunService.Heartbeat:Wait()) as an option)

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