ViewModel Left Arm CFrame pointing issue

  1. What do you want to achieve? Keep it simple and clear!
    I want to achieve an effect where the left arm can properly point to a LeftGrip, such as a Grip gun attachment or the barrel.

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that the angle that is produced is causing an undesirable roll effect on the arm, which looks unnatural.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I already tried removing the Z axis entirely, but that only created more issues.

Here is the main update loop function:

Connect(function(dt) -- Main update function
	if (this_WeaponModel and #this_Viewport > 0) then
		local Left_Arm, Right_Arm = this_Viewport[1], this_Viewport[2]
		Left_Arm.CFrame, Right_Arm.CFrame = Workspace.CurrentCamera.CFrame * Settings.LeftArmPos, Workspace.CurrentCamera.CFrame * Settings.RightArmPos
		this_WeaponModel:SetPrimaryPartCFrame(Right_Arm.CFrame * CFrame.new(Right_Arm.Size.X/2, 0, 0) * Settings.WeaponOffset)
		
		local find = this_WeaponModel:FindFirstChild(tostring(WeaponModel:GetAttribute("SecondaryPart")))
		if (find) then
			Left_Arm.CFrame = CFrame.new(Left_Arm.Position, find.Position) * CFrame.Angles(0, math.pi/2, 0) * CFrame.new(math.clamp((Left_Arm.Position - find.Position).Magnitude/2, -Left_Arm.Size.X/2, Left_Arm.Size.X/2), 0, 0)
		end
	end
end, RunService.RenderStepped)

I solved this before, the issue is with CFrame.new which likes to point the top face of the arm up. Solution should be to get rid of this behavior, one way is to CFrame from matrix

The second option should be to use CFrame.lookat the newer version and input the cameras.CFrame.up vector into the third parameter to make the arm point up relative to the camera and not the world UpVector (0,1,0)

Thank you, I found the CFrame.fromMatrix method a bit complicated because you wrote that specifically for them, so I used the second method and it worked fine.