How to make arms rotate relative to camera

I want to make the character’s arms (R6) rotate relative to the camera.

The issue is that with my current script, it does not move relative to the camera.

What I have:

What I want to achieve:

my script:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local mouse = player:GetMouse()

local torso = character:WaitForChild("Torso")

local rightS = torso:WaitForChild("Right Shoulder")
local leftS = torso:WaitForChild("Left Shoulder")

game["Run Service"].RenderStepped:Connect(function()
	
	character["Left Arm"].LocalTransparencyModifier = 0
	character["Right Arm"].LocalTransparencyModifier = 0
	
	local hit = (torso.Position.Y - mouse.Hit.Position.Y)/100
	local mag = (torso.Position - mouse.Hit.Position).Magnitude/100
	local offset = hit/mag

	rightS.C0 = rightS.C0:Lerp(CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -offset), 0.3)
	leftS.C0 = leftS.C0:Lerp(CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, offset), 0.3)
end)

the gun was free model :wink:

The script is not mine (I used to have a script for this, but my stupid brain forgot where it was :cry: )

I looked at the devforum, and I couldn’t find any solutions for this other than “create a view model”

edit: script that I had did the same thing that I have rn

the angle of the arms should be something like

local difference = mouse.Hit.Position - torso.Position

--atan2 takes (difference in upwards, difference sideways)
local angle = math.atan2(difference.Y, Vector2.new(difference.X, difference.Z).Magnitude)

if that doesnt work then maybe

--this constructor is (origin position, looking at this position)
local angle = CFrame.new(Torso.Position, mouse.Hit.Position):ToOrientation().X -- could be z

then the target cframe (this example for right arm) would be

CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0,0,angle)

I tried these in studio, and they do not work :cry:

edit: I mean, it does point to the reticle now, but it does not move relative to the camera.

also, I’m gonna change the free model to the other gun (the spawner) as I realized that the AK47 actually moved the waist.