Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Usage
Returns the squared distance to a unit in your group
distanceSquared, checkedDistance = UnitDistanceSquared("unit")
Parameters
Arguments
- unit
- String - The unitId for the player in your group
Returns
- distanceSquared
- Number - the squared distance to that unit
- checkedDistance
- Boolean - true if the distance result is valid, false otherwise (eg. unit not found or not in your group)
Patch changes
- Patch 7.1.0 (2016-10-25): Returns nil while inside a restricted area (instance/battleground/arena).