How would I make players arms move depending on only the y axis?

Hi, I am trying to make the players arms move vertically with the camera. I’ve made a script which does that, but it makes the arms move sideways too. I’ve seen games like Survive and Kill the Killers in Area 51 !!! do what I am trying to do. Any help would be appreciated!

This is my script

local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local humanoid = script.Parent:WaitForChild('Humanoid')
local humanoidRootPart = script.Parent:WaitForChild('HumanoidRootPart')
local rightShoulder = script.Parent.Torso:WaitForChild('Right Shoulder')
local leftShoulder = script.Paren.Torso:WaitForChild('Left Shoulder')
local runService = game:GetService('RunService')

runService.RenderStepped:Connect(function()
	local cameraCFrame = camera.CFrame
	rightShoulder.C0 = (cameraCFrame * CFrame.new(1, -1, -0.8)):ToObjectSpace(humanoidRootPart.CFrame):Inverse() * CFrame.Angles(0, math.pi / 2, 0)
	leftShoulder.C0 = (cameraCFrame * CFrame.new(-1, -1, -0.8)):ToObjectSpace(humanoidRootPart.CFrame):Inverse() * CFrame.Angles(0, -math.pi / 2, 0)
end)

I’m pretty sure you can make an animation (It’s probably much easier)

Changing the weld of the arms is the best solution. I believe you need to retrieve the mouse position first.

I’m not using mouse though, I’m using the camera

Then that’s the camera.CFrame.LookVector.

I already have the script, it just does this weird thing where if I look left and right the arms will move horizontally and I don’t know how to fix it

That’s because you’re moving them in multiple directions. You need to use the CFrame in only one direction, which is Y.

I don’t really know how to do that, everything I’ve tried resulted in an error saying I’m trying to use Vector3