R6 Make arms follow mouse

I found a script for R15 where it makes the player’s arms turn to where their mouse is looking. I was wondering, would there be a way to do this with R6? I’ve tried different solutions, but to no avail. Here’s the R15 script:

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

RunService.RenderStepped:Connect(function()
	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

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

bumping this, i need help with this as well

same i dont get this either sorry for the bump