I have a raycast suspension car that currently jitters when it’s driving across an edge with 2 of its’ wheels in the air. Here is how it looks:
The spring code:
local velocity = springdir:Dot(car:GetVelocityAtPosition(fa.WorldPosition))
local offset = (rideheight-ray.Distance)
local force = (offset * tune.springstiffness) - (velocity * tune.springdamping)
No clue what causes this honestly. Any help is appreciated.
Raycasts are 1-dimensional lines so the collision detection is bound to be very buggy. One moment it’s on flat ground, but if you drift 0.1 studs then you’re suddenly in midair. Try using shapecasts instead; the new generalized shapecast was just released recently and you can use the entire wheel model as the casting shape.