Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

facing

Comments in 'Plugin Development' started by Creeperface, Aug 5, 2015.

  1. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    hi i learned trigonometry but i dont know e.g. how many ° is when player is facing X+ and how many ° is when facing Z+
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    var_dump($player->getYaw());
    Shows the degrees the player is facing.
    Warning: it may be out of range of 0-360 degrees, but just use ($yaw % 360) to normalize it.
    Warning: sin(), cos() and tan() accept parameters in radians. Use deg2rad (or / 180 * M_PI before PHP 7 if you want to make it run faster) to convert degrees to radians.
    Asparanc and Creeperface like this.
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    i know but it take long time so do you know which yaw player has when facing x+ and z+
    and thx
  4. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Thanks PEMapModder :) i've add it on onPlayerMove function and it work perfectly !
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Try using BasicHUD

Share This Page

Advertisement