UI rotate with 3D object on Z Axis?

Like the title says, i have an aircraft but when flying you can lose all sense of rotation so i need to have a rotation indicator to indicate the horizon…
the problem is how do i make a UI object rotate with 3D object on just the Z axis ?

RectTransform’s have a rotation property just like regular Transforms.

hudElement.rotation = Quaternion.Euler(0, 0, jet.localEulerAngles.z);

thank you(sorry, it’s been like a year)