It's probally really simple but I'm making a tank turret rotate to the mouse position.
I have this piece of code here.
Mouse.Move:connect(function()
MouseX = Vector3.new(Mouse.Hit.x,0,Mouse.Hit.z)
Turret.TurretWeldToHull.C0 = CFrame.new(Turret.Position,MouseX):inverse() * CFrame.new(Turret.TurretWeldToHull.Part0.Position.x, Turret.TurretWeldToHull.Part0.Position.y - 7,Turret.TurretWeldToHull.Part0.Position.z)
end)
But I have two problems.
I. The turret starts doing weird stuff whenever the mouse comes near it. I'm trying to spin the turret in one axis.
(ex. of problem) https://gyazo.com/1cbfb68bc806c63ee1bddec37aa86d0b
II. The turret is facing the wrong way! How can I fix that?
Thank you!
