Arma 3 Scripting

Command in Object Detection

targets

Also available as Markdown and JSON, or read the original wiki page.

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:

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