unity transform.rotation.y code example
Example 1: transform.rotation
transform.eulerAngles = new Vector3(0, 0, 180);
transform.localEulerAngles = new Vector3(0, 0, 180);
transform.eulerAngles = new Vector3(0, 0, 180);
transform.localRotation = Quaternion
transform.rotation = Quaternion.Euler(0, 0, 90);
Example 2: transform.rotation = closestTransform.rotation;
transform.rotation = closestTransform.rotation;