Transforming Head relative to Arms

Hello, I am currently working on some gun system things and I came across an issue getting sights to line up. The arms track the mouse as the player pans around, however, the sights never line up. I’m suspecting this is due to the static nature of the camera, which looks up and down but never moves to match the transform of the weapon.

if name == "Head" then
					local headcf = humanoid.Parent:FindFirstChild('Head')
					if headcf then
						cf = CFrame.new(headcf.CFrame.UpVector * Vector3.new(0,1 * (camera.CFrame.Rotation.X / 80), 0),Vector3.new(0,0,0))
					end
				end

This code obviously isn’t working for me, and I suspected that it wouldn’t. But I’m attempting to get the head to move in position relative to the rotation of the camera’s CFrame (80 being the clamp, so looking fully down -80 degrees would cause your camera to transform 1 stud.)

Any suggestions on how to achieve this without a hacky solution?

Video example:

External Media
3 Likes

I’m bumping this once more. I’ll look for a solution when I get home today.

i’m bumping this once more. i feel like i was on the right track, yet I had no time to work on it much today, any help is appreciated and I can elaborate for anyone willing to help