After finishing the X/Z Rotation for my tank turret, I needed to do the Y elevation for the barrel, I’m running into a slight problem,
When you use the W/S to move the barrel up/down, the whole turret moves with it. here is a video demonstrating my issue
It uses normal weld (Not WeldConstraint) to move up down, here is my code to mvoe tur turret Up/Down, Side/Side
local seat = script.Parent local driver = seat.Occupant local turret = script.Parent.Parent.Turret local weld = script.Parent.Parent.Body.TurretWeld local weld2 = script.Parent.Parent.Barrel.TurretWeld while true do wait() if seat.Steer == -1 then weld.C0 *= CFrame.Angles(0,0.003,0) end if seat.Steer == 1 then weld.C0 *= CFrame.Angles(0,-0.003,0) end if seat.Throttle == 1 then weld.C0 *= CFrame.Angles(-0.005,0,0) end if seat.Throttle == -1 then weld.C0 *= CFrame.Angles(0.005,0,0) end end
Is there any fix to this, if so, help is greatly appreciated!