Arma 3 Scripting

roadAt

  • Global argument
  • Arma 3 v1.58

Command · Markdown · JSON · original wiki page

Description

Returns a road segment containing given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean.

Syntax

roadAt position

Parameters:

Returns: Object - road segment or objNull

Examples

Example 1

_road = roadAt ASLToAGL getPosASL player;

Example 2

_isOnRoad = !isNull roadAt player;

Example 3

For detecting bridges, for example:

getModelInfo (roadAt ASLToAGL getPosASL player); // ["bridgesea_01_f.p3d", "a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d", true]

See also

nearRoads · roadsConnectedTo · isOnRoad · surfaceIsWater · getRoadInfo · nearestTerrainObjects

Community notes

OOKexOo

This command does not necessarily return the segment which center is the closest to the given position.

In order to get such segment use nearRoads.

_closest_road = (_pos nearRoads 0.1) select 0;