→ WoW API
Returns whether a unit is close to the player.
local inRange, checkedRange = UnitInRange("unit")
- String (unitId) - unit to query; information is only available for members of the player's group.
- Boolean - true if the unit is within ~40 yards of the player, false otherwise
- Boolean - true if a range check was actually performed; false if the information about distance to the queried unit is unavailable.
Patch 5.0.4 (2012-08-28): Added
checkedRange return value.