UnitDistanceSquared

From Wowpedia
Revision as of 03:10, 24 August 2016 by Ketho (talk | contribs) (Created page with "{{wowapi}} __NOTOC__ ==Usage== Returns the squared distance to a unit in your group distanceSquared, checkedDistance = UnitDistanceSquared("unit") == Parameters == === Arg...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Game Flavors
Links
Patch
Added in 6.0.2 / 1.13.2

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

  • Legion Patch 7.1.0 / API (2016-10-25): Returns nil while inside a restricted area (instance/battleground/arena).