Transform.eulerAngles only x and z

Hi, I have to rotate a Gameobject only to the x and z to 0.00f and 0.00f, but I’d like that the x angle will be the same that in the previous frame.
(so no in this way)

GameObject.Find (“player”).transform.rotation = Quaternion.AngleAxis (0.0f,Vector3.right);

GameObject.Find (“player”).transform.rotation = Quaternion.AngleAxis (0.0f,Vector3.forward);

thanks

This solution should work:

Transform playerTransform = GameObject.Find ("player").transform;
playerTransform.rotation = Quaternion.Euler(0, playerTransform.rotation.eulerAngles.y, 0);

Vector3 currentRotation = playerTransform.rotation.eulerAngles;
playerTransform.rotation.eulerAngles = new Vector3(0, currentRotation.y, 0);