I’m making a ray cast vehicles but car slides,I looked all around the internet for more information but my vehicle would still slide, fling or disappear.
Im using a Vector Force (Set to World) on each wheel, this is a snippet of the code to put the force on an attachment.
--Suspension
local worldVelocity = chassis:GetVelocityAtPosition(wheelAtt.WorldPosition)
local springDir:Vector3 = relativeUP
local offset = displacement
local velocty = springDir:Dot(worldVelocity)
local spf = (offset*configs.SpringStrength*mass) - (velocty * configs.SpringDamper)
local suspensionForce = springDir*spf
--Slip
-- need help here. (local slidingForce = ?)
--Controls
local thrust = relativeFOWARD*0
local forceVector = (suspensionForce) + (thrust) -- + (slidingForce)
force.Force = forceVector
visulizeForce(wheelAtt.WorldPosition,force.Force, classOfWheel)
What the car currently looks like

This is the attachment which has a vector force. The fake wheel or the translucent wheel has an offset from the collision and is not reletive to the wheel attachment. The attachment below the top attachment is the ‘root’ attachment which send down the ray. the blue lines are a force visulizer.

In Conclusion
-
The car does not have a force to prevent it from sliding.
-
All the forces are summed up to create a total force
-
There is a ‘root attachment’ which sends a ray and theres a ‘force attachment’ which makes the car ‘stand up’ (using a VectorForce) and is offset to properly send the force.
-
The suspension or the floating force does not have any problems. (Create a diffrent vector force for each axis? - Suspension Up ; Sliding and Steering Right ; Throttle and Brake Foward/LookVector)*