im making a tank and its not turning very well. sometimes it turns fine but most of the time it doesnt.
video: (collision points are shown thats what all the red dots are)
code:
if toSteer == -1 and toThrottle == 0 then
if motor.Parent.Name:lower() == "right" then motor.AngularVelocity = speed * settings.turn_speed end
if motor.Parent.Name:lower() == "left" then motor.AngularVelocity = -speed * settings.turn_speed end
elseif toSteer == 1 and toThrottle == 0 then
if motor.Parent.Name:lower() == "left" then motor.AngularVelocity = speed * settings.turn_speed end
if motor.Parent.Name:lower() == "right" then motor.AngularVelocity = -speed * settings.turn_speed end
end
the wheels are connected with a hinge constraint and rotated with a cylindrical constraint
the tracks are connected by two invisible parts. which are connected to the wheels with hinges. those two parts are connected by a prismatic constraint (see picture) (the connected wheel is fixed {no suspension})
