Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make a tanks turret rotate with a weld?

Asked by 4 years ago
Edited 4 years ago

for example the weld would part0 would be the body and the part1 would be the turret mesh how would i rotate it towards the mouse(on the y rotation axis) here is the code i have so far



local hit=game.ReplicatedStorage:FindFirstChild("R"):InvokeClient(occupent,0x01)--get player who is sitting in the seats mouse CFrame local x,y,z=CFrame.new(v.Turret.Position,hit.p):ToEulerAnglesXYZ() turotweld.C0= turotweld.C0= turorigionc0*CFrame.fromEulerAnglesXYZ(0,-y,0)--turotweld is the --weld i am using to rotate the turret, v.Body is the body part

this seems to "work" at first but you cant rotate the turret backwards

0
w h a t holadivinus 4 — 4y
0
if you don't understand it, don`t respond... iop2319 0 — 4y
0
Rotate the turret backwards if the mouse is in the direction opposite the turrent's lookvector. radiant_Light203 1166 — 4y

Answer this question