BIS_fnc_nearestPosition

From Bohemia Interactive Community
Revision as of 12:49, 19 March 2020 by Lou Montana (talk | contribs) (Text replacement - " <nowiki>[</nowiki>" to " [<nowiki/>")
Jump to navigation Jump to search
Introduced with Arma 2 version 1.001.00
Hover & click on the images for descriptions

Description

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

Syntax

Syntax:
[items, origin] call BIS_fnc_nearestPosition
Parameters:
items: Array of Object, Location, Group, String (marker) and/or Position - note that for a group, leader's position is used
origin: Object, Location, Group, String (marker) or Position
Return Value:
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;

Additional Information

Execution:
call
See also:
nearObjectsnearestObjectnearestObjectsBIS_fnc_nearestPointBIS_fnc_nearestNumBIS_fnc_nearestRoadBIS_fnc_nearestHelipadBIS_fnc_isPosBlacklisted

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Notes

Bottom Section