How to modify a transform.rotation

Hi all, I have a transform and I need to change the x rotation to 270 .

Whats the easiest way to do this

Vector3 eulerAngles = transform.rotation.eulerAngles;
eulerAngles.x = 270f;
transform.rotation.eulerAngles = eulerAngles;
transform.rotation.x = 270;

:slight_smile:

Modifying the x rotation of the quaternion won’t necessarily set the x-rotation to 270 in world space.

hmm You have a point @Trumble i didn’t thought in that respect.