BodyGyro issues when coming too close to an object/collision issues

So, I’ve asked this a while now, so I will repost this.

Hey everyone. This is the issue, with collisions:
How would I stop this object from flipping? --post with old thread
I am using body-gyro, but I am not very experienced with it, so I would appreciate any help on how to make this stay up the right way.

You could try something like this:
image
Make it so that you weld the model to the “hitbox” and only move the hitbox.
Make sure the parts have the Massless properties set to true.

Have you tried playing around with the MaxForce values to see if that affects it.
Also I’m guessing you have 2 Gyros in the tank since the turret and the chassis are tilting/rotating separately. Have you tried with just 1 to see if that ‘fixes’ the issue?

I will test all of your replies… I will tell you if it changes anything!

And here’s the code if you are wondering (for the Move function)

function Move(hum, bodyvel, finish, target, unit)--Basically moving the guy to the waypoint
	if hum then 
		hum:MoveTo(target)

		if finish then
			hum.MoveToFinished:Connect(function(reached)
				return true
			end)
		end
		return true
	elseif bodyvel then
		--bodypos.P = 300
		bodyvel.Velocity = Vector3.new(0,0,0)
		sleep(1)
		bodyvel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		if unit == "Artillery" then
			bodyvel.Velocity = ((target)-bodyvel.Parent.Position).Unit*Vector3.new(artillerySpeed,0,artillerySpeed)
			savedvel = ((target)-bodyvel.Parent.Position).Unit*Vector3.new(artillerySpeed,0,artillerySpeed)
		elseif unit == "Tank" then
			bodyvel.Velocity = ((target)-bodyvel.Parent.Position).Unit*Vector3.new(tankSpeed,0,tankSpeed)
			savedvel = (target-bodyvel.Parent.Position).Unit*Vector3.new(tankSpeed,0,tankSpeed)
		end
		bodyvel.Parent = bodyvel.Parent
		bodyvel.Parent:FindFirstChild("BodyGyro").P = 3000
		bodyvel.Parent:FindFirstChild("BodyGyro").MaxTorque = Vector3.new(0,400000,0)
		bodyvel.Parent:FindFirstChild("BodyGyro").CFrame = CFrame.new(bodyvel.Parent.Position, target)
		print(target)
		spawn(function()
			while wait(0.01) do
				print("running")
				if (bodyvel.Parent.Position-target).Magnitude <= 2 and not (savedvel ~= bodyvel.Velocity) then
					print("stopppiedappie")
					bodyvel.Velocity = Vector3.new(0,0,0)
					break
				elseif savedvel ~= bodyvel.Velocity then
					print(savedvel)
					print("stopppiedappie")
					print(bodyvel.Velocity)
					break
				end
			end
		end)
		return true
	end
end

I already had the hitbox, it was called torso

Have you tried increasing the X and Z MaxTorques in this line? Shouldn’t need a lot there, just enough to tilt the tank back to level.

Oh oops, forgot to say, I already fixed it!