Help with making an ADS for my gun system

Hello, I’m currently making a gun system for me to use across all my games, but ive been having some issues with making an ADS system.

The way my gun system works is it basically uses the whole R15 rig, No viewmodels, just a tool and the players character whilist adujsting the CFrame of the shoulders joints.

I tried making an “aim part” that sits on the ironsights of the gun and shifts the shoulders CFrame so that the aimparts CFrame is in line with the camera, but it didnt work how i intended it to do, i wrote to an ai to help fix this because its been a while now and it just gave me crappy code (like always)

How do i go my way to make this? Ive genuinely tried every solution i can think of.. :pensive_face::pensive_face::pensive_face:

(heres the code for it, though the shoulders are the only ones intended to move, gen dont know what im doing anymore)

if aiming == true then
		local camCF = camera.CFrame
		local torsoCF = character.UpperTorso.CFrame        
		local aimCF = script.Parent.Handle.AimPart.CFrame

		local aimToRightArm = aimCF:ToObjectSpace(character.RightUpperArm.CFrame)
		local aimToLeftArm  = aimCF:ToObjectSpace(character.LeftUpperArm.CFrame)
		local torsoToCam    = torsoCF:ToObjectSpace(camCF)

		rightElbow.C0 = aimRightElbowC0
		rightWrist.C0 = aimRightWristC0
		leftElbow.C0  = aimLeftElbowC0
		leftWrist.C0  = aimLeftWristC0

		rightShoulder.C0 = (torsoToCam * aimToRightArm * rightShoulder.C1) 
		leftShoulder.C0  = (torsoToCam * aimToLeftArm  * leftShoulder.C1)

	else
		rightShoulder.C0 = defaultRight
		rightElbow.C0    = defaultRightElbow
		rightWrist.C0    = defaultRightWrist

		leftShoulder.C0  = defaultLeft
		leftElbow.C0     = defaultLeftElbow
		leftWrist.C0     = defaultLeftWrist
	end


)

ignore some of the flaws in the animations it still isnt done :anxious_face_with_sweat:

Hey! I’m not very experienced in this regaurd but consider using a ViewportFrame (?). I’m not sure if you already are but if not then it could make things easier.

Try manipulating the camera by using CFrame:Lerp()

ViewportFrames are GUI objects, you can’t really use those.

Never mind i fixed it, turns out i had a weird bug with one of my other scripts and now it works properly, Sorry for the trouble :pensive_face: