Make arm go straight?

So I got this little script and it makes the right arm follow the mouse, but I only want it to go up and down but it doesnt side to side aswell, anyway to change that?

local RunService = game:GetService("RunService")

local Player = game.Players.LocalPlayer

local PlayerMouse = Player:GetMouse()

local Camera = workspace.CurrentCamera

local Character = Player.Character or Player.CharacterAdded:Wait()

local Head = Character:WaitForChild("Head")

local Neck = Head:WaitForChild("Neck")

local Arm = Character:WaitForChild("RightUpperArm")

local Shoulder = Arm:WaitForChild("RightShoulder")

local Humanoid = Character:WaitForChild("Humanoid")

local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

local NeckOriginC0 = Neck.C0

local ShoulderOriginC0 = Shoulder.C0

Neck.MaxVelocity = 1/3


	local CameraCFrame = Camera.CoordinateFrame

	if Character:FindFirstChild("UpperTorso") and Character:FindFirstChild("Head") then

		local ArmLookVector = Arm.CFrame.lookVector

		local HeadPosition = Head.CFrame.p

		if Neck and Shoulder then

			if Camera.CameraSubject:IsDescendantOf(Character) or Camera.CameraSubject:IsDescendantOf(Player) then

				local Point = PlayerMouse.Hit.p

				local Distance = (Head.CFrame.p - Point).magnitude

				local Difference = Head.CFrame.Y - Point.Y

				Shoulder.C0 = Shoulder.C0:lerp(ShoulderOriginC0 * CFrame.Angles(-(math.asin(Difference / Distance)), (((HeadPosition - Point).Unit):Cross(ArmLookVector)).Y, 0), .5 / 2)




1 Like

Replace the second argument of CFrame.Angles with 0.

It didnt work, it just errors it.

What error message does it give?