Make arms rotate up and down based on where the camera is pointing (R6)

  1. What do you want to achieve? Keep it simple and clear!
    Make it so that your arms rotate up and down based on where the mouse is pointing whilst keeping the animation

  2. What is the issue? Include screenshots / videos if possible!
    https://gyazo.com/6e9337d5e01c8c209505b59b83186ea0
    This is what I have right now, I’m trying to find a solution to this, but I can’t

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve gone on youtube to find a tutorial, but I couldn’t find anything.

you could watch this tutorial and experiment around with it by applying the effect to Left and Right shoulder

2 Likes

I used the same video as the tutorial it is a while ago. The video is a great follow!
To save some time I tweaked it to work with the head and the waist as well.
However, works as well as moving/rotating arms in my opinion.

You can tweak it pretty easy to move/rotate arms later if you want or need to though

Hope this helps!

I added a waistSensitivity variable that may need to be adjusted for specific needs.
(0 being unresponsive, to >1 being very responsive)
0.9 is what I use for my third-person system. For FPS you might want to set to 1.
I Haven’t tested this in FirstPerson.

Local Script inside StarterCharacterScripts

local camera = game.Workspace.CurrentCamera;
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
local neck = character:FindFirstChild("Neck", true)

local waistSensitivity = 0.9

local neckC0 = CFrame.new(0, 0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local waistC0 = CFrame.new(0, 0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);

game:GetService("RunService").RenderStepped:Connect(function()
	if neck and player.Character.Humanoid.Health > 0 then 
		local theta = math.asin(camera.CFrame.LookVector.y)
			local neck = player.Character.Head.Neck;
			local waist = player.Character.UpperTorso.Waist;
			neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(theta*0.5, 0, 0);
			waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(theta* waistSensitivity, 0, 0); --/<!!/  Where waistSensitivity is found
	end
end)

Side Note:: This will only work for the client because of course it is a “Local Script” and sadly I haven’t even started the replication to the server-side yet for this script so your on your own there!

Edit: Added a fix: local character = player.Character or player.CharacterAdded:Wait() since sometimes the “Neck” would error because the character was not fully loaded.

2 Likes

Thank you, I’ll watch the video and change it to the Right and Left Shoulder motors