how to align to cover?

transform.rotation = coverHitInfo.transform.rotation is working correctly only for Z or -Z direction of cover object;

206137-capture.png