been working on a scripted vehicle
im using no constraints and its all done through vector forces
but theres an issue i cant figure out whats wrong with it with the side friction (stop wheels from slipping to the side) makes the car fling itself
code:
function calculateRightFriction(base, gripFactor, attachment, props, dt)
local velocity = getVelocityAtPoint(base, attachment.WorldPosition)
local rightVelocity = base.CFrame:VectorToWorldSpace(RIGHT):Dot(velocity)
local mass = (base.AssemblyMass * workspace.Gravity)
local trueFriction = props.Friction * gripFactor
local forceScale = (trueFriction * mass)
local rightForce = forceScale * -rightVelocity
return rightForce * RIGHT
end
gripFactor = 0.8
props.Friction = the friction of the part under the car
RIGHT = Vector3.new(1, 0, 0)
the force just keeps going up and up then it flings it
what this should do is push it in the opposite direction of where its slipping, this should be just slightly above the right velocity to slow it down