reseate rotation with a script unity code example
Example 1: simple reset transform.rotation c#
transform.rotation = Quaternion.identity;
Example 2: how to chagne rotation in unity
transform.eulerAngles = new Vector3(0f, 180f, 0f); // rotates 180 degrees
Example 3: how to reset rotation in unity
transform.rotation = Quaternion.Euler(transform.rotation.x, transform.rotation.y, 0);