I’m just messing around using two attachments with a first-person ViewModel to position each arm using CFrame(Pos1,Pos2) when I ran into this problem. I want the arms to be angled towards the end position while maintaining the same upvector and the rest of the rig.
Seems like a problem with CFrame.new() at high pitch angles from:
At high pitch angles (around 82 degrees), you may experience numerical instability. If this is an issue, or if you require a different up vector, it’s recommended you use CFrame.fromMatrix instead to more accurately construct the CFrame. Additionally, if lookAt is directly above pos (pitch angle of 90 degrees) the up vector switches to the X-axis.
Like it says try using CFrame.fromMatrix instead by using the attachments rightvector
Then you would need to follow the example from the API-Reference:
function lookAt(target, eye)
local forwardVector = (target - eye).Unit
local upVector = Vector3.new(0, 1, 0)
-- Remember the right-hand rule
local rightVector = forwardVector:Cross(upVector)
local upVector2 = rightVector:Cross(forwardVector)
return CFrame.fromMatrix(eye, rightVector, upVector2)
end
where the Forward vector is the vector from the LefStart to the LeftEnd world position.