Hello, I am making an FPS game, but the recoil is based on framerate. Like, the higher framerate, the more the recoil. How would I fix this?
Anyone know? I’m using RunService to render
You can account for the variable frequency at which the various event loops are fired by utilising their step parameter, this parameter describes the total length of time which has elapsed since the previous cycle (iteration) of the event loop.
local run = game:GetService("RunService")
run.Stepped:Connect(function(elapsed, step)
local recoilAmount = 2 * step
end)
In this example the recoil amount is 2 studs per second (regardless of frame-rate).