Unityでtransform.rotationには直接値を代入できません。
値を代入したい時は、以下です。
float x = 90; this.transform.rotation = Quaternion.Euler(0.0f, 0.0f, x);
回転させたい時は、以下です。
float x = 90; this.transform.Rotate(0.0f, 0.0f, x);
参考:
Unityでtransform.rotationには直接値を代入できません。
値を代入したい時は、以下です。
float x = 90; this.transform.rotation = Quaternion.Euler(0.0f, 0.0f, x);
回転させたい時は、以下です。
float x = 90; this.transform.Rotate(0.0f, 0.0f, x);
参考: