How could I make your arms and head follow your mouse up and down?

I think this is solved because nobody is posting.

I still dont get this
i need this for my game

Yo i am confused too because i am trying to make the same thing but i don’t understand what i nead to do in your script to make it work! here what i am in your script!:

also here is the error

nvm i found out how to do it lol

Hi sorry to bump this topic but I’m using this code for the arms:

        local rightX, rightY, rightZ = char.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
		char.Torso["Right Shoulder"].C0 = (char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))

		local leftX, leftY, leftZ = char.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
		char.Torso["Left Shoulder"].C0 = (char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))

But when I go into first person the arms start moving closer/away from the camera:

Does anyone know how I can fix this?

I also used this but it acts the same way:

        char.Torso["Right Shoulder"].C0 =,0.5,0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).unit.y),1.55,0)
		char.Torso["Left Shoulder"].C0 =,0.5,0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).unit.y),-1.55,0)
1 Like

Because your arms are rotating relative to themselves, not the camera. And since the camera rotates relative to itself, it doesn’t line up. You either have to use a view model, make the arms move relative to the camera, or move the camera relative to the arms.

I am having this problem too

but I dont how to fix and yes I am using Motor6D animations

I’m pretty sure he’s looking for an R6 version of this, this script is meant for R15 rigs.

Hello, sorry for the bump, but how did you do it? I don’t know how to use “self” and what i found in devforum doesn’t explain why studio says "unknown global ’ self ’ " i really like this arm pointing to camera (or mouse) effect

You can do

local Char = game.Players.LocalPlayer.Character;

and replace every



1 Like

I made some changes so the arms point their bottom face instead of front but it worked, thanks!!

i just changed self.Right arm to this :

local run = game:GetService("RunService")

local equipped = false

local player = game.Players.LocalPlayer

local char = game.Players.LocalPlayer.Character

repeat wait() until player.Character


local mouse = game.Players.LocalPlayer:GetMouse()

local Torso = game.Players.LocalPlayer.Character.Torso

local RightArm = game.Players.LocalPlayer.Character['Right Arm']



equipped = true

local rightX, rightY, rightZ = Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()

Torso["Right Shoulder"].C0 = (Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))

local leftX, leftY, leftZ = Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()

Torso["Left Shoulder"].C0 = (Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))





RightArm.ToolGrip.Part0 = RightArm

RightArm.ToolGrip.Part1 = WeaponTool.BodyAttach




1 Like

Good idea, I isolated the mouse following parts of the scripts you’re referring to, specifically the pistol’s scripts from the following game.


local replicated = game:GetService("ReplicatedStorage")
local remote = replicated:WaitForChild("RemoteEvent")
local run = game:GetService("RunService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local character = player.Character	
local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
local head = character:WaitForChild("Head")
local torso, rightArm, neck, rightShoulder
if humanoid.RigType == Enum.HumanoidRigType.R6 then
	torso = character:WaitForChild("Torso")
	rightArm = character:WaitForChild("Right Arm")
	neck = torso:WaitForChild("Neck")
	rightShoulder = rightArm:WaitForChild("Right Shoulder")
elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
	torso = character:WaitForChild("UpperTorso")
	rightArm = character:WaitForChild("RightUpperArm")
	neck = head:WaitForChild("Neck")
	rightShoulder = rightArm:WaitForChild("RightShoulder")

local function onRenderStep()
	local state = humanoid:GetState()
	if not state then return end
	if state == Enum.HumanoidStateType.Swimming then return end
	local mousePosition = mouse.Hit.Position
	local toMouse = (mousePosition - head.Position).Unit
	local angle = math.acos(toMouse:Dot(, 1, 0)))
	local neckAngle = angle

	if math.deg(neckAngle) > 110 then
		neckAngle = math.rad(110)

	if humanoid.RigType == Enum.HumanoidRigType.R6 then
		neck.C0 =, 1, 0) * CFrame.Angles(math.pi - neckAngle, math.pi, 0)
	elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
		neck.C0 =, 0.84, 0) * CFrame.Angles(math.pi/2 - neckAngle, 0, 0)
	local fromArmPos = torso.Position + torso.CFrame:vectorToWorldSpace( + rightArm.Size.X/2, torso.Size.Y/2 - rightArm.Size.Z/2, 0))
	local toMouseArm = ((mousePosition - fromArmPos) *, 0, 1)).Unit
	local look = (torso.CFrame.lookVector *, 0, 1)).Unit
	local lateralAngle = math.acos(toMouseArm:Dot(look))

	if tostring(lateralAngle) == "-1.#IND" then
		lateralAngle = 0
	if state == Enum.HumanoidStateType.Seated then
		local cross = root.CFrame.lookVector:Cross(toMouseArm)
		if lateralAngle > math.pi/2 then
			lateralAngle = math.pi/2
		if cross.Y < 0 then
			lateralAngle = -lateralAngle

	if humanoid.RigType == Enum.HumanoidRigType.R6 then
		rightShoulder.C0 =, 0.5, 0) * CFrame.Angles(math.pi/2 - angle, math.pi/2 + lateralAngle, 0)
	elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
		rightShoulder.C0 =, 0.5, 0) * CFrame.Angles(math.pi/2 - angle, lateralAngle, 0)

	if state ~= Enum.HumanoidStateType.Seated then
		root.CFrame = CFrame.lookAt(root.Position, root.Position + (, root.Position.Y, mousePosition.Z) - root.Position).Unit)
	remote:FireServer(neck.C0, rightShoulder.C0)


local replicated = game:GetService("ReplicatedStorage")
local remote = replicated.RemoteEvent

local function onRemoteFired(player, neckC0, rightShoulderC0)
	local character = player.Character
	if not character then return end
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid then return end
	if humanoid.Health <= 0 then return end
	if humanoid.RigType == Enum.HumanoidRigType.R6 then
		local torso = character.Torso
		local neck = torso.Neck
		local rightShoulder = torso["Right Shoulder"]
		neck.C0 = neckC0
		rightShoulder.CO = rightShoulderC0
	elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
		local head = character.Head
		local neck = head.Neck
		local rightArm = character.RightUpperArm
		local rightShoulder = rightArm.RightShoulder
		neck.C0 = neckC0
		rightShoulder.C0 = rightShoulder.C0


Here’s the place file for anyone that may need it.
Mouse.rbxl (27.9 KB)

Since you did not say what in the vid you wanted to make, I will assume you meant the effect of the sword, it is just a simple trail with two attachments and a decal…

Then as he is running it makes the trail.

The arms movement, how you can move so freely

It just looks like a custom animation…

It seems when I run the mouse.rbxl , the players right shoulder has a gap from the body…


It isn’t moving arms would just fall, and the user can control them there.

I managed to cloned left shoulder and right shoulder welded and parented to the head and make the neck move up and down by the camera with RunService.RenderStepped also use RunService.Stepped to update the animation from the real joint to fake joint
Put this script in StarterCharacterScripts

--R6 Only
local RunService = game:GetService("RunService")

local camera = workspace.CurrentCamera
local character = script.Parent

local torso = character:WaitForChild("Torso")
local head = character:WaitForChild("Head")

local rightShoulder = torso:WaitForChild("Right Shoulder")
local leftShoulder = torso:WaitForChild("Left Shoulder")
local neck = torso:WaitForChild("Neck")

local rightShoulderCopy ="Motor6D")
rightShoulderCopy.C0 =, -1, 0) * rightShoulder.C0.Rotation
rightShoulderCopy.C1 =, .5, 0) * rightShoulder.C1.Rotation
rightShoulderCopy.Part1 = rightShoulder.Part1
rightShoulderCopy.Name = "RightShoulderCopy"
rightShoulderCopy.Archivable = false
rightShoulderCopy.Part0 = head
rightShoulderCopy.Parent = head

local leftShoulderCopy ="Motor6D")
leftShoulderCopy.C0 =, -1, 0) * leftShoulder.C0.Rotation
leftShoulderCopy.C1 =, .5, 0) * leftShoulder.C1.Rotation
leftShoulderCopy.Part1 = leftShoulder.Part1
leftShoulderCopy.Name = "LeftShoulderCopy"
leftShoulderCopy.Archivable = false
leftShoulderCopy.Part0 = head
leftShoulderCopy.Parent = head

rightShoulder.Enabled = false
leftShoulder.Enabled = false

	neck.C0 =, 1.5, 0) * CFrame.Angles(math.asin((camera.Focus.Position - camera.CFrame.Position).Unit.Y), 0, 0)
	neck.C1 =

	rightShoulderCopy.Transform = rightShoulder.Transform
	leftShoulderCopy.Transform = leftShoulder.Transform

	local _camera = workspace.CurrentCamera
	if _camera then
		camera = _camera

Hope this fixed for you