Description
Retrieves list of given unit targets matching specified filter. If the filter is not specified, all targets are returned.
Note
If a unit is provided, the unit itself will be excluded from results. If a group is provided, its units will be excluded (even if renegades).
Syntax
unitOrGroup targets [enemyOnly, maxDistance, sides, maxAge, alternateCenter]
Parameters:
unitOrGroup: Object or Arma 3 v2.12 Group - unit or group which target knowledge is retrievedenemyOnly: Boolean - (Optional, default false) true to include only enemy targets, false to include all targetsmaxDistance: Number - (Optional, default -1) maximum 2D distance based on target's expected position; use 0 to ignore the filtersides: Array of Sides - (Optional, default[]) array of accepted sides; use[]to ignore the side filtermaxAge: Number - (Optional, default 0) max. target age, targets that are known to unit for longer than maxAge are ignored; use 0 to ignore the maxAge filteralternateCenter: Array - (Optional, default unitOrGroups position) alternate (2D or 3D) position used for 2D' distance check
Returns: Array - unitOrGroup's targets matching the criteria
Examples
Example 1
private _targets = _unit targets [false, 300, [east, sideEnemy]]; // all targets of east or renegade side in 300m
Example 2
private _targets = _unit targets [true, 300]; // enemy targets in 300m
Example 3
private _targets = _unit targets []; // all targets
See also
targetsQuery · nearTargets · targetsAggregate · targetKnowledge · knowsAbout · reveal · forgetTarget · setTargetAge · getHideFrom · side