Convert Unreal Quaternion to Unity

This may be simple to some, but I kinda suck at math.

I need code to convert the rotation I have in Unreal to Unity. My understanding is both use a left hand coordinate system, but in Unity forward is Z, right is X, and up is Y. In Unreal forward is X, right is Y, and up is Z.

There’s not much math here just a remapping between coordinates.

Rotation around
… X is now rotation around Z
… Y is now around X
… Z is now around Y

You’re probably thinking about euler angles (which are stored internally as quaternions) but the simple remapping stands.