Return Object Rotation to x axis is zero

Hi everyone

My object Rotates in the x, y, z axis. But now I want my object returns only in the X axis into 0.0 if I click a GUI.Button.

Can Someone help me please. The z and y axis don’t maight be changed, only the x axis.

You can do it like this:

CS

    var rot = transform.eulerAngles;
    rot.x = 0;
    transform.eulerAngles = rot;

JS

  transform.eulerAngles.x = 0;