I'm trying to make the characters arm always point towards the mouse but can't seem to get it.
What I've tried so far:
--// Vars
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local rightArm = char:WaitForChild("RightUpperArm")
local mouse = plr:GetMouse()
--// Arm moving loop
while wait() do
local mouseHit = mouse.Hit.p
rightArm.CFrame = CFrame.new(rightArm.Position, Vector3.new((mouseHit.X, mouseHit.Y, mouseHit.Z))
end

6 comments
Don't use while wait() do. Instead use RenderStepped of RunService.
Okay thanks. I changed it but instead of just the arm moving the whole player goes flying in the direction of the mouse.
Also just pass mouseHit instead of constructing a new Vector3 since mouse.Hit.Position is a Vector3 (dont use .p)
So it would just be rightArm.CFrame = CFrame.new(rightArm.Position, mouse.Hit)
well, Cframes have a position property with which you can get their position matrix
Hmm can someone show me an example of this? I’m a little lost.