Vector3 direction help

I have a HingeConstraint Servo and I want to set the TargetAngle to always face North.

local servo = HingeConstraint

game:GetService("RunService").HeartBeat:Connect(function()
   servo.TargetAngle = --?
end)

How would I get the correct angle to point north relative to world space?

Are you trying to make one of these things?

image

Well, I think just set the angle to negative Y axis rotation of it’s parent. This should negate the rotation so it tries to point in the same direction. I don’t know how it would react if you flipped the thing upside-down or sideways though.

local c = servo.Parent.CFrame
local x,y,z = c:ToOrientation()
servo.TargetAngle = -y -- Maybe?