I have a raycast suspension car (so basically just a hovercar) that is supposed to be elevated a fixed amount above the ground. However, since I am multiplying the calculated force by the car’s CFrame UpVector, the height gets increased when the car is resting on a steep incline.
Normal height:
Incline height:
Here is the (simplified) spring code:
local offset = (rideheight-ray.Distance)
local velocity = upv:Dot(car:GetVelocityAtPosition(raypos))
local force = (offset * tune.springstiffness) - (velocity * tune.springdamping)
spring.Force = force*upv.Unit
Not sure what to do in this situation, since interfering with the ride height can cause problems. Any help is appreciated.