Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I stop a "hover-car" from drifting sideways? [closed]

Asked by 5 years ago

I'm trying to make a car that "hovers", similar to the jailbreak cars, and I made a couple lines of code to try to stop it from drifting sideways. But whatever I do, I just can't get it to work :(

DriftStopper = Instance.new("BodyForce")
DriftStopper.Parent = Body
while true do
    DriftStopper.Force = -(Body.Velocity * Body.CFrame.lookVector).X * traction * Body.CFrame.RightVector
end

Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

Well I solved it. Basically I have no idea how vectors work, so I went to the discord and got: DriftStopper.Force = -Body.CFrame:VectorToWorldSpace(Vector3.new(Body.CFrame:VectorToObjectSpace(Body.Velocity).X,0,0)) * traction

Ad