Can`t make character`s arm look at mouse

I want to make character’s right arm to look in direction mouse is pointing at. the issue is, no matter what method I use, I don’t get the result I need. from spinning 360 degrees during walking or getting joints deformed to getting flinged beyond INF coordinates. how to make it work? I’ve spent many hours for just one small script

I removed arm code lines because they aren’t working anyways

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local mouse = LocalPlayer:GetMouse()
local tool = script.Parent

tool.Equipped:Connect(function()
	local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
	local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
	local torso = character:FindFirstChild("Torso")
	if not humanoidRootPart or not torso then return end

	local rightArm = torso:FindFirstChild("Right Shoulder")
	local head = torso:FindFirstChild("Neck")
	if not rightArm or not head then return end

	local defaultRightArmC0 = rightArm.C0
	local defaultHeadC0 = head.C0

	local watchCursor
	watchCursor = RunService.RenderStepped:Connect(function()
		local mouseHit = mouse.Hit
		if mouseHit then
			local rootPos = humanoidRootPart.Position
			local targetPos = Vector3.new(mouseHit.Position.X, rootPos.Y, mouseHit.Position.Z)
			local lookAtCFrame = CFrame.lookAt(rootPos, targetPos)
			
			humanoidRootPart.CFrame = lookAtCFrame
		end
	end)
	
	script.Parent.Unequipped:Wait()
	watchCursor:Disconnect()
end)

It looks like, maybe unintentionally, you’re setting the HumanoidRootPart.CFrame to lookAtCFrame. That will make the whole character snap to face the mouse every frame, which causes spinning, joint deformation, or even fling issues. Instead, you should only rotate the arm’s joint (RightShoulder / RightUpperArm) to point at the mouse, not the root part or torso

I deleted arm code and kept other lines right now, and i change hrp CFrame to make character turn at mouse direction

What is the result you’re actually looking for? Can you give me context on what the script is for?

right arm points at the position my mouse points at. I point my mouse at the ground and arm looks in that position. instead, it doesn’t react to mouse movement, but reacts at character walking

found a working freemodel in toolbox