- Home /
Difference between transform.forward and transform.position.z?
I'm confused over what the difference between transform.forward and transform.position.z are.
The Unity Script Reference describes Transform.position as "the position of the transform in world space" and Transform.forward as "the blue axis of the transform in world space." Does this mean transform.forward is an alias for transform.position.z or am I missing something here?
Answer by Eric5h5 · Dec 29, 2011 at 06:48 PM
transform.forward is the forward direction (not position) for an object. Note that the blue axis for an object does not necessarily align with the world Z axis; it depends on how the object is rotated. transform.position.z is, as noted, the position in world space.
Your answer
Follow this Question
Related Questions
calculating the midpoint of two objects 4 Answers
don't include vertical distance? 2 Answers
Stop moving at the target position by using Vector3.forward 0 Answers
how to ignore transform.position.y 3 Answers