Hello everyone, I’m working on a ball racing game where friction isnt reliant on Roblox physics and rather it’s own calculation. My current issue is when the FPS lowers, not enough friction is applied and when FPS is higher too much friction is applied. I want players to all have have the same opportunities and power despite framerate
Visualization:
Low FPS
Intended FPS
Here is my friction code:
game:GetService("RunService").RenderStepped(function(dt)
local ThisMarble = --Just a part
local CurrentPush = 100
local PushModification = 0
local Friction = 0.035
local Delta = 60 / (1/dt)
print(Delta)
ThisMarble.Velocity = ThisMarble.Velocity:Lerp((Input * (CurrentPush + PushModification)* 1 ^ Delta), Friction) * (Vector3.new(1,0,1) + (ThisMarble.Velocity * Vector3.new(0,1,0)))
end)
I’ve tried tons of different methods but all either send me to the floating point error zone or just have no effect at all. Any help is appreciated!
Edit: Added missing friction variable to code my bad :B