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;
Results appear below as you type; use the arrow keys to move through them.
Returns a road segment containing given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean.
roadAt position
Parameters:
position: Object or PositionAGL (especially on bridges) or Arma 3 v2.00 Position2D - array, in which case Z will be automatically deduced as the height of the road surfaceReturns: Object - road segment or objNull
_road = roadAt ASLToAGL getPosASL player;
_isOnRoad = !isNull roadAt player;
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]
nearRoads · roadsConnectedTo · isOnRoad · surfaceIsWater · getRoadInfo · nearestTerrainObjects
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;