1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to move an entity in a straight line using it's yaw?

Discussion in 'Facepalm' started by mal0ne_23, Jun 26, 2017.

  1. mal0ne_23

    mal0ne_23 Spider Jockey

    Messages:
    30
    GitHub:
    mal0ne-23
    Hey. So let's say an entity is facing 180 yaw, how would I get the entity to go forward in that direction? Like how would I return the positions in front of it
     
  2. mal0ne_23

    mal0ne_23 Spider Jockey

    Messages:
    30
    GitHub:
    mal0ne-23
    Why was this moved to facepalm...?
     
  3. Intyre

    Intyre Administrator Staff Member PMMP Team

    Messages:
    81
    GitHub:
    Intyre
  4. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    Perhaps Entity::getDirectionVector() can help you.
    (It doesn't return an absolute position in the world, but a position relative to the player's position afaik)

    If you don't care about the y coordinate, there's also Entity::getDirectionPlane().
     
    Last edited: Jun 27, 2017
  5. mal0ne_23

    mal0ne_23 Spider Jockey

    Messages:
    30
    GitHub:
    mal0ne-23
    Thanks
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.