Rotations Not Matching with What is in Inspector

I was experimenting and I have stumbled upon a problem.

When I click on my object and look at it's rotation I see a completely different number from when I look at the console after running `print(transform.rotation);` ("transform" is the same object). In fact there are four numbers (x, y, z, w), instead of the usual three (x, y, z).

Can someone explain this to me? I think it's printing the quaternions?

Thanks.

I haven'T figured all the subtilities but long story short, yes, the Inspector is showing a V3 representation of the Quaternion used 'behind' the interface. To use V3,which are somewhat easier to figure than Quaternion, eulerAngles would do the trick. Then again, just use Quaternion, I barely ever need to 'figure' them.

1 Answer

1

That's not a problem; transform.rotation is a quaternion, and what's in the inspector is transform.eulerAngles.

Ok, thanks for the clarification.