reset object rotation unity code example
Example 1: simple reset transform.rotation c#
transform.rotation = Quaternion.identity;
Example 2: how to get rotation of object in unity c#
float angleX = myTransformGO.rotation.eulerAngles.x;
float angleY = myTransformGO.rotation.eulerAngles.y;
float angleZ = myTransformGO.rotation.eulerAngles.z;
Example 3: how to reset rotation in unity
transform.rotation = Quaternion.Euler(transform.rotation.x, transform.rotation.y, 0);