Every Unity GameObject has an associated transform, which comprises three vectors: position, rotation, and scale.

If you want to change the rotation, you use the Rotate method.

If you want to know what the rotation is, you'd think you'd access the rotation field. There is such a field, but it's not the one you want. You need to use eulerAngles.

πŸ€¦β€β™‚οΈ

Behind the scenes, rotation is actually a Quaternion. I understand there are reasons for this, but displaying it in the Inspector as Rotation (with three components), and setting it using Rotate (with a Vector3 and an angle) made me expect that rotation would be a Vector3.

Follow

@peterdrake But really, you just shouldn't use euler angles ever because they're so error-prone. Learning to use the quarternion rotations saves you a lot of headache in the future.

Β· Β· 0 Β· 0 Β· 1
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.