I want to achieve a more stabilized raycast suspension using PiD Controllers and VectorForces
PID.Gains.kP = MaxSuspensionLength -- 2
PID.Gains.kI = Attribute(Vehicle, 'IntegeralTest') -- 1
PID.Gains.kD = Damping -- .3
local Test = Spring:Calculate(SuspensionLength, RaycastResult.Distance, deltaTime)
VehicleRoot:ApplyImpulseAtPosition(VehicleRoot.CFrame.UpVector * Test, RaycastResult.Position)
The goal is something this smooth
PS I also need to figure out how to incorporate mass as a factor in the PiD equation so it can work across multiple vehicles