unity scripting reset rotation of object to 0 code example
Example 1: how to reset rotation in unity
transform.rotation = Quaternion.identity;
Example 2: how to reset rotation in unity
transform.rotation = Quaternion.Euler(transform.rotation.x, transform.rotation.y, 0);