Arma 3 Scripting

Command in Object Detection

nearestBuilding

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

Description

Finds the nearest building to a given object or position. A "building" is defined as an object that is of class "House" and contains a path LOD.

Syntax

nearestBuilding position

Parameters:

Returns: Object

Examples

Example 1

_nBuilding = nearestBuilding player;

Example 2

_nBuilding = nearestBuilding position player;

See also

buildingPos · nearestObject · nearestObjects · nearObjects · nearestLocation · nearEntities · nearTargets · nearSupplies · nearestLocationWithDubbing · nearObjectsReady · nearRoads · nearestMines

Community notes

Tankbuster

Some large buildings are not found by this command. "Land_Airport_Tower_F", "Land_Offices_01_V1_F" and "Land_Hotel_02_F" are examples.