TransformDirection(Vector3.forward) vs transform.forward

Forum Archive TransformDirection(Vector3.forward) vs transform.forward

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7727
    Riccardo Chioetto
    Participant

      What’s the difference between using TransformDirection(Vector3.forward) and transform.forward?

      #27561
      Jonathan Gonzalez
      Participant

        TransformDirection “transforms” the direction from local space to world space. Transform.forward uses the “blue axis” of the transform in world space which is the Z axis, but also takes into account the rotation of the object. The latter can be useful for moving an object along it’s Z axis, so if it rotates it’ll always point in the direction of the objects Z axis. 

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The topic ‘TransformDirection(Vector3.forward) vs transform.forward’ is closed to new replies.