Why only "transform.rotation"?

Why doesn’t “Quaternion.Euler(transform.rotation.x, transform.rotation.y, transform.rotation.z)” run like “transform.rotation”? Just curious.

Are transform.rotation.x and etc. not floats?

Transform.rotation returns a Quaternion, which has x,y, and z values but they are not the same kind of x,y,z values you’d expect from vectors and coordinates. Actually, there are four values that make up a Quaternion: they are x,y,z,w

Even the Unity manual says its not recommended to deal with Quaternion coordinates directly because they are very complicated. It instead has tools for converting Quaternions to and from easier systems to work with such as angles and euler angles.

Hi Anthony,

I learned this later in the course, but thanks so much for getting back to me!

Sincerely,
Aubrey

Privacy & Terms