Thread: New API Usage
View Single Post
08-07-14, 04:01 AM   #5
Cybeloras
A Fallenroot Satyr
 
Cybeloras's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 28
Unfortunately, UnitDistanceSquared only works on group members (party and raid). It does exactly what you would expect - returns the square of the distance to the unit in yards. Its second return is false if the unit cannot be checked.

UnitPosition has the same restrictions. It returns exact x, y, z, mapID coordinates for any group members (and yourself). For example, right now in Ashran I'm getting (4000.6, -4066.8, 1047687, 1191) as the return values.

These do have quite the interesting implications, even if they don't work on hostiles, pets, or ungrouped players.