{"name":"roadAt","title":"roadAt","type":"command","url":"https://community.bistudio.com/wiki/roadAt","revid":377838,"updated":"2026-01-03T04:32:28Z","groups":["Roads and Airports"],"status":"ok","games":{"arma3":"1.58"},"since":"arma3 1.58","arma3_since":"1.58","locality":{"argument":"global"},"description":"Returns a road segment containing given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean.","syntaxes":[{"syntax":"roadAt position","params":[{"name":"position","type":"Object or PositionAGL (especially on bridges) or Arma 3 v2.00 Position2D","description":"array, in which case Z will be automatically deduced as the height of the road surface","type_expr":"Object | PositionAGL | Position2D"}],"returns":{"type":"Object","type_expr":"Object","description":"road segment or objNull"},"form":"unary","right":{"text":"position"}}],"examples":[{"code":["_road = roadAt ASLToAGL getPosASL player;"]},{"code":["_isOnRoad = !isNull roadAt player;"]},{"text":"For detecting bridges, for example:\n\n```sqf\ngetModelInfo (roadAt ASLToAGL getPosASL player); // [\"bridgesea_01_f.p3d\", \"a3\\structures_f_exp\\infrastructure\\bridges\\bridgesea_01_f.p3d\", true]\n```","code":["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"],"notes":[{"user":"OOKexOo","date":"2016-12-30T21:40:00Z","text":"This command does not necessarily return the segment which center is the closest to the given position.\nIn order to get such segment use nearRoads.\n\n```sqf\n_closest_road = (_pos nearRoads 0.1) select 0;\n```"}]}