Changing rotation values for only the x axis

Hi guys,

I need to flip my shooter object 180 degrees to keep bullets flying at the right angle from left to right
unfortunately transform.rotation = Quaternion.Euler(180, 0, 0);
Sets the object to the right angle but any value on the z (The tilt of the gun) is lost.
Is there a way to set the value of X axis without resetting what is in there?

I have googled and watched Youtube videos but just cant resolve this.

You could always just use transform.Rotate instead. Just plug in your angle you want it to rotate by.

why is this
gameObject.transform.Rotate(180, 0, 0);

making x axis -180?

180 and -180 are the same exact thing. The perils of relying on euler angles. I recommend dealing only in Quaternions whenever possible.