Arma 3 Scripting

BIS_fnc_nearestPosition

  • Arma 3 v0.50
  • First in Arma 2 v1.00

Function · Markdown · JSON · original wiki page

Description

Function to find the nearest Object or position from a list, when compared to a given reference.

Syntax

[items, origin] call BIS_fnc_nearestPosition

Parameters:

Returns: Object, Location, Group, String (marker) or Position - the closest from items

Examples

Example 1

// Find the nearest marker from player
_nearestMarker = [allMapMarkers, player] call BIS_fnc_nearestPosition;

Example 2

// Find the nearest marker to trigger using trigger onActivation code
_nearestMarker = [allMapMarkers, thisTrigger] call BIS_fnc_nearestPosition;

See also

nearObjects · nearestObject · nearestObjects · BIS_fnc_nearestPoint · BIS_fnc_nearestNum · BIS_fnc_nearestRoad · BIS_fnc_nearestHelipad · BIS_fnc_isPosBlacklisted