Need help with fixing a tank

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.

Is there any other way I can stop this from happening? Or am I stuck like this unless I redo the whole tank?

What if you just disabled the bodygyro when not turning by setting the maxTorque to 0?

edit: Why not use bodyangularvelocity?

It works, but it turns even if I dont press D/A

I can try that, I will get back to you soon.

All that did was make my tank breakdance

Can I see the tank control script?

Sure, here it is

(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

Can you show a video of the tank turning?

Sure. Here is a video:
robloxapp-20210331-0103416.wmv (2.1 MB)

Maybe set the angular velocity and torque lower?

1 Like

It works, Thank you! Now I can get back to work, gave a good day!