Rotating to a given rotation with a specific direction on a given axis

Hi!
I have a rotated GameObject, when rotating the GameObject I used Quaternion.Lookrotation (the gameObject is parented and the parent is also rotated).

I want to bring back the localrotation of the GameObject to Identity BUT the catch is that I have a desired rotation direction on a given axis (global space, in my case X)(ex. clockways, counterclockways)

I am working on a platformer so, the rotation on X is always 0 and when turning the character I change it scale to -1.

Does anyone know an easy way of doing this?

Thanks in advance!

Take a look at the Quaternion.AngleAxis(angle, transform.left); command. It sounds like it might be what you’re looking for.