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

How do i make a BodyVelocity's Velocity go to the direction the car's front is facing?

Asked by 5 years ago

So i made a car, that is runned with a BodyVelocity and a BodyAngularVelocity. But if i turn, The bodyvelocity's velocity only goes in one direction. How can i fix this, and make the BodyVelocity go to the direction the car's front is facing?

script:

local s = script.Parent
local car = s.Parent
local stats = car.Base.Stats

local function changed(pro)
    if pro == "Throttle" then
        car.Base.BodyVelocity.Velocity = Vector3.new(0,0,stats.TopSpeed.Value) * s.Throttle
        car.Base.BodyVelocity.MaxForce = Vector3.new(0,0,stats.Acceleration.Value)* 3000 * s.Throttle
    end
        if pro == "Steer" then
        car.Base.BodyAngularVelocity.AngularVelocity = Vector3.new(0,-stats.TurnSpeed.Value,0) * s.Steer
        end

end
s.Changed:Connect(changed)
0
bump ieatandisbaconhair 77 — 5y
0
That won't bump the question. User#19524 175 — 5y
0
lmao ieatandisbaconhair 77 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I dont think "Body Velocity" is what you want.

Try using the "Body Thruster" instead

Ad

Answer this question