{"name":"BIS_fnc_nearestPosition","title":"BIS fnc nearestPosition","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_nearestPosition","revid":328399,"updated":"2022-07-13T16:00:49Z","groups":["Positions"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Function to find the nearest Object or position from a list, when compared to a given reference.","syntaxes":[{"syntax":"[items, origin] call BIS_fnc_nearestPosition","params":[{"name":"items","type":"Array of Object, Location, Group, String (marker) and/or Position","description":"note that for a group, **leader's position** is used","type_expr":"Array<Object | Location | Group | String | Position>","text":"items: Array of Object, Location, Group, String (marker) **and/or** Position - note that for a group, **leader's position** is used"},{"name":"origin","type":"Object, Location, Group, String (marker) or Position","type_expr":"Object | Location | Group | String | Position"}],"returns":{"type":"Object, Location, Group, String (marker) or Position","type_expr":"Object | Location | Group | String | Position","description":"the closest from items","text":"Object, Location, Group, String (marker) or Position - the closest from *items*"}}],"examples":[{"code":["// Find the nearest marker from player\n_nearestMarker = [allMapMarkers, player] call BIS_fnc_nearestPosition;"]},{"code":["// Find the nearest marker to trigger using trigger onActivation code\n_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"]}