I want the player’s right arm to move with the mouse on BOTH the x and y axis.
I have figured out only how to move the y axis… and I think because the character can do a full 360 with the x axis of their mouse.hit.p this happens:
local RightShoulder = Character.Torso:WaitForChild("Right Shoulder")
local dir = Mouse.Hit.Position - Mouse.Origin.Position
local angle = math.atan2(dir.Y, math.sqrt(dir.X^2+dir.Z^2))
local Xangle = math.atan2(dir.X, math.sqrt(dir.Z^2+dir.Y^2))
local rotationCf = CFrame.Angles(angle, -Xangle, 0)
RightShoulder.C0 = CFrame.new(1, 0.5, 0) * rotationCf * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))