The gun is pointing towards where the mouse is looking

The character moves with the gun.

-Script

local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local mouse = player:GetMouse()
local tool = player.Backpack:WaitForChild("Tool")

local bodyAttach = tool:WaitForChild("BodyAttach") 

local function rotateTool()
	local worldPosition = bodyAttach.Position
	local lookVector = (mouse.Hit.Position - worldPosition).unit
	local horizontalRotation = math.atan2(lookVector.X, lookVector.Z)

	bodyAttach.CFrame = CFrame.new(worldPosition) * CFrame.Angles(0, horizontalRotation, 0)
end


RunService.RenderStepped:Connect(function()
	if tool:IsA("Tool") and tool.Parent == player.Character then
		rotateTool()
	end
end)

Hey @Ahmelaga1, Did you disable weapon collision, it looks like the character is blocking through it?

1 Like

Yes, i disabled weapon collision.