Hello. I am trying to get my turret to rotate to wherever the players mouse is pointing. I’ve tried achieving it and sorta worked but sorta not.
Explorer:
Basically the script below technically works but it rotates the whole tank due to welds. Now at the start of the game the tank is welded in the Framework script to keep the tank from falling apart. But i’m guessing that these welds are making it so the whole tank is rotated when i move my mouse.
LocalScript (Tank.LocalScript)
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local TurretUnion = game.Workspace.M4Sherman.BodyKit.Turret.PrimaryPart
while wait() do
TurretUnion.CFrame = CFrame.new(TurretUnion.Position, mouse.Hit.Position)
end