Arma 3 Scripting

nearestBuilding

  • Arma 3 v0.50
  • First in Operation Flashpoint v1.00

Command · Markdown · JSON · 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.