Glitchy Scripted Suspension when fps is low

I’m trying to make a stable scripted suspension suitable for low fps and mobile, but the suspension goes nuts on low fps times or random times in mobile. Here’s the game if u wanna see The Game

Video
robloxapp-20201227-1813469.wmv (1.1 MB)

It was stable at first until I enabled the lag machine

The Code

RunService.RenderStepped:Connect(function()
	Move = Vector3.new(0,0,-VehicleSeat.Throttle)
	for i = 1,#Thrusters do
		local Thruster = Thrusters[i]
		local Hit,EndP,Normal = workspace:FindPartOnRay(Ray.new(Thruster.Position,Thruster.CFrame.UpVector*-Height),Main)
		local Velocity = Thruster.CFrame:VectorToObjectSpace(Thruster.Velocity)
		local Dist = Height-(Thruster.Position-EndP).Magnitude
		local Force = (Mass*Dist)
		local Force = -(Velocity.Y*Mass)/40 + (Force/4)

		Thruster.Color = Color3.fromHSV(math.abs(Force/Mass),1,1)

		if Hit then
			Thruster.BodyThrust.Force = Vector3.new(-(Velocity.X*((FrictionX/1000)*Mass)),Force,-(Velocity.Z*((FrictionZ/1000)*Mass))) + (Move)*Mass
		else
			Thruster.BodyThrust.Force = Vector3.new(0,0,0)
		end
	end
end)

I believe that the frame rate is causing the body movers to be very erratic and difficult to control. Behavior is similar between all other body movers. In this case, BodyThrust.

The similar case is here:

1 Like

I have tried to lessen the force on how low the frame rate is and it somewhat works