Distance between two players

Discussion in 'Plugin Development' started by 0verFull, Aug 1, 2015.

Thread Status:
Not open for further replies.
  1. Offline


    Hi guys and girls,

    I just know how to calcul the distance between two players ?

  2. location.distance(otherLocation)
  3. Offline


    @0verFull And if you want to know how that actually works behind the scenes:
    Just some simple geometry!

    PDKnight and ItsMattHogan like this.
  4. Offline


    distanceSquared if using it a lot. (With of course squaring your seeked distance too)

    Basically doesn't use expensive Math.sqrt method.
  5. Offline



    Math.sqrt isn't expensive. The difference between the distance() and distanceSquared() is a fraction of the time it takes to call the method.
Thread Status:
Not open for further replies.

Share This Page