Returns the squared distance to a unit in the player's group. The distance returned appears to work from anywhere (even across continents and instance boundaries, although the answer is of dubious value).

See also Map functions.


distanceSquared, checkedDistance = UnitDistanceSquared("unit")


  • unit - A unit in the player's party or raid (string, unitID)


  • distanceSquared - Distance to that unit, squared (number)
  • checkedDistance - true if the distance result is valid, false otherwise (eg. unit not found) (boolean)