Ive tried absolutely everything. Ive multiplied everything by dt, ive used heartbeat, i used heartbeat from server, ive used a while loop, ive used accumulators. i tried using only the difference for spring position, nothing. nothing works and im pretty sure its an issue with the module itself. ive tried timeskipping by dt, still nothing.
tl;dr if anyone can provide an example of what they did for their recoil systems using springs that would be great.
and recommend me a different module or something because quenty’s spring module is dependent on fps no matter what. i think its how it calculates deltatime itself is busted and im not fixing it. even deepseek cant figure out how to fix it.
task.wait does not have to wait the time you specified. You are assuming it takes 0.01 and then updating by that much. That’s already framerate dependent.
Adding on to azqjanna’s reply, you can get the amount that task.wait waited using the return value from it.
You can also just connect it to RunService.RenderStepped and use the deltaTime parameter (probably more common). (Edit: I didn’t see you had already tried Heartbeat.)
Here is BlackShibe’s copy (I bet the real one is on GitHub or something):
I’d have to see your code for updating the spring to determine what’s going on. I’ve used Quenty’s spring in the past, and I’ve never noticed this problem.
Edit: Actually x_o’s module might need to be modified. Here is a modified version that’s meant to be framerate independent:
dont think there is a solution to this honestly ive had this issue ever since ive made fps guns. never fixed it, terrible at math so i probably will never fix it. will just have this as a feature until i can steal someone elses code.
task.wait(5)
while task.wait(0.01) do
client:Update(0.01)
client:Heartbeat(0.01)
end
end)
Perhaps try this?
local THIS_FPS = 60
task.spawn(function()
task.wait(5)
dt = task.wait(0.01)
while true do
client:Update(dt * THIS_FPS)
client:Heartbeat(dt * THIS_FPS)
end
end)
EDIT: Didn’t see you already tried dt; if you have, chances are it’s the module itself, not you. You’ll have to dig in and fix it, but it should only be a matter of multiplying every FPS-dependent operation by dt times whatever frame rate you want to maintain