⇐ Index
Available in version 1.3 and later.
GetNearestSpecialTarget(<-specialTarget <-worldPosition <-range <-includeIsBuilding) ->unit
Finds the nearest unit that is tagged as a special target within range (a float) from worldPosition (a vector3). The 'specialTarget' argument is a V4 that specifies the target types. See GetUnitSpecialTarget.
If no unit matching the special target parameter is found, -1 is returned.
For clarification: Line Of Sight is not factored. If you want to use this API with LOS restrictions, see GetTerrainLOS.
Spores, Blobs, etc, aren't special targets and will not be detected.
GetNearestSpecialTarget(V4(1 1 0 0) GetUnitPosition(self) GetUnitRange(self) false) ->unit
⇐ Index