How would I rotate a Motor6D on 1 axis?

I have a easy script that makes my players hands follow the mouse for a first person shooter i’m working on. I only want the arms to move vertically.
What’s Happening:


Example:

I looked through various discussions on this site and scripterhelpers, but non worked or they didn’t work with what’s going on with my arm controlling.

SCRIPT:

local ArmLookVector = Arm.CFrame.lookVector
local ArmLookVector2 = Arm2.CFrame.lookVector
local HeadPosition = Head.CFrame.p
local Point = PlayerMouse.Hit.p
local Distance = (Head.CFrame.p - Point).magnitude
local Difference = Head.CFrame.Y - Point.Y

Shoulder2.C0 = Shoulder2.C0:lerp((Shoulder2OriginC0) * CFrame.Angles(-(math.asin(Difference / Distance)),(((HeadPosition - Point).Unit):Cross(ArmLookVector2)).Y, 0), .5 / 2)

Yes it is in a renderstep.That’s all you should need to see from the script.

I don’t know how, but this line of code fixed it. Here it is for anyone having the same issue. My code works with r15 not r6.

Shoulder.C0 = ShoulderOriginC0 * CFrame.Angles((-(math.asin(Difference / Distance))),(((HeadPosition - Point).Unit * Vector3.new(0,0,0)):Cross(ArmLookVector)).Y, 0)