how to edit tranform rotation from script ??

i need to edit tranform rotation from script, how i can do that ??

You can change the rotation of a object by changing the value of transform.rotation, however, you probably will want to use transform.eulerAngles. Euler Angles are represented by the x, y, and z axes (Like in the inspector window).

transform.eulerAngles = new Vector3(0, 15, 0);

This will set the y rotation to 15, and the x and z rotation to 0.

You can also use transform.Rotate to rotate an object by a certain increment.

transform.Rotate(new Vector3 (20, 0, 5));

This will rotate the object by 20 degrees around the x axis, and 5 degrees around the z axis.