SC2Mapster.com Wiki

SC2 API / Functions / UnitGroupNearestUnit

UnitGroupNearestUnit

unit UnitGroupNearestUnit(unitgroup g, point p)

Nearest unit of the group from the point.

Parameters

unitgroup g

Unit group

point p

Point

Return value

unit -

  • null: The unit group is either empty / null
  • unit: The nearest unit of the group

Examples

Example: Sample Usage
unitgroup UnitGroupAllUnits() {
  return UnitGroup(null, -1, null, null, 0);
}

unit u = UnitGroupNearestUnit(
  UnitGroupAllUnits(),
  Point(50, 50)
);
// The nearest unit of the point (50, 50)

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Mar 29, 2010
Last updated
Mar 29, 2010

Author