API UnitInRange

From Wowpedia
Jump to: navigation, search

Returns whether a unit is close to the player.

local inRange, checkedRange = UnitInRange("unit")

Arguments

unit 
String (unitId) - unit to query; information is only available for members of the player's group.

Returns

inRange 
Boolean - true if the unit is within ~40 yards of the player, false otherwise
checkedRange 
Boolean - true if a range check was actually performed; false if the information about distance to the queried unit is unavailable.

Patch history

Mists of Pandaria Patch 5.0.4 (2012-08-28): Added checkedRange return value.