Archives

Get Vector3 from Quaternion / Rotate Vector3

September 13, 2011 by

To get the vector from a quaternion rotation you simply multiply the quaternion by the forward vector.

Debug.DrawRay(transform.position, transform.rotation * Vector3.forward, Color.red);

This also effectively rotates the forward-vector with the rotation of the transform, positioning it relative to the rotation of the actual object.

New category “HowTo”

September 13, 2011 by

I’m getting a bit fed up having to look up everything with google when programming. Therefore I’ll add everything I need and find here (even if it isn’t all that extrodinary).