I am trying to get the direction that a cube is facing after rotation. I got the normalized vector as follows:
Vector3 forwardVector = transform.forward.normalized;
Debug.Log(forwardVector);
and this gives (0, 1, 0)
but when I print out the separate axes such as:
Debug.Log("X " + forwardVector.normalized.x);
Debug.Log("Y " + forwardVector.normalized.y);
Debug.Log("Z " + forwardVector.normalized.z);
I get
x = 0
y = 1
z = -1.19…E-07
Shouldn’t normalized round off to 1, -1 etc? Also, why is the individual z different from the reading as a whole (0, 1, 0)??
Thanks,
Syed