Hey, My Character is a Tank. Right now my tank is moving with W,A,S,D.
https://i.imgur.com/VeZzInb.gif
I need the canon to always face the Mouse.
I saw that script here https://scriptinghelpers.org/questions/74839/character-wont-look-at-mouse-pointer And I tried to make it fit my needs, but it didnt work
local TankHead = game.StarterPlayer.StarterCharacter.CanonHead
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local rs = game:GetService("RunService").RenderStepped
rs:Connect(function()
local hrp = TankHead:WaitForChild("Tank_Cannon_1")
local lookAt = Vector3.new(mouse.Hit.p.X, hrp.Position.Y, mouse.Hit.p.Z)
TankHead:SetPrimaryPartCFrame(CFrame.new(hrp.Position, lookAt))
end)
https://i.imgur.com/cPQpMEh.png
Someone Have an idea ?
IS it because the Canon is Rig ?
