Relative rotation with physics constraints

You need to “set constraint reference orientation” . pir axis is the forward vector and sec axis is the right vector and it will automatically calculate the orientation. to invert the z axis, change the frame.
I have used a scene component to orient the physics constraint instead of using gizmo. then set the reference frame of the physics constraint in BP

NOTE: use “get relative rotation” for scene component , i mistakenly used “get world rotation”