- Home /
Question by
RoR · Feb 13, 2011 at 06:58 AM ·
transformdirection
How should TransformDirection be used?
How should TransformDirection be used? What does it do exactly?
Comment
Best Answer
Answer by Jesse Anders · Feb 13, 2011 at 07:41 AM
TransformDirection() transforms a vector (as opposed to a point) from local space to world space. A common example of use is this:
forward = transform.TransformDirection(Vector3.forward);
Which computes the world-space z axis for an object. (Note that transform.forward is a shortcut for the above.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613104040im_/https://answers.unity.com/themes/thub/images/avi.jpg)