Hi, I’m working on tanks for my game but there is a slight issue, they don’t follow physics, It has a BodyGyro in it, but I cant remove it because its reliant on it to turn.
(sorry if its bad, I’ve never worked with BodyAngularVelocity before.)
local seat = script.Parent
local speed = 0
local bv = script.Parent.BodyVelocity
local bg = script.Parent.BodyAngularVelocity
while true do -- a never ending loop
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
if seat.Steer == 0 then
bg.AngularVelocity = Vector3.new(0,0,0)
end
if seat.Steer == 1 then
bg.AngularVelocity = Vector3.new(0,0,1)
elseif seat.Steer == -1 then
bg.AngularVelocity = Vector3.new(0,0,-1)
end
end