Hi, I’m working on some vehicles for my game, I’m using BodyAngularVelocity to turn them, however BodyAngularVelocity turns even without me pressing A/D in my vehicle
Here is my code:
local seat = script.Parent
local speed = 0
local bv = script.Parent.BodyVelocity
local bg = script.Parent.BodyAngularVelocity
while true do
wait()
if seat.Throttle == 1 then
if speed < seat.MaxSpeed then
speed = speed + 0.5
end
bv.Velocity = script.Parent.CFrame.LookVector * speed
elseif seat.Throttle == 0 then
if speed > 0 then
speed = speed - 0.5
elseif speed < 0 then
speed = speed + 0.5
end
bv.Velocity = script.Parent.CFrame.LookVector * speed
elseif seat.Throttle == -1 then
if speed > -seat.MaxSpeed then
speed = speed - 0.25
end
bv.Velocity = script.Parent.CFrame.LookVector * speed
end
seat.Changed:Connect(function()
if seat.Steer == 1 then
bg.AngularVelocity.Z = Vector3.new(0,0,1)
elseif seat.Steer == -1 then
bg.AngularVelocity.Z = Vector3.new(0,0,-1)
elseif seat.Steer == 0 then
bg.AngularVelocity.Z = 0
end
end)
end
And the settings on the BodyAngularVelocity:
Is there a known way to fix this, if so please help!