{"name":"roadAt","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.58"}],"since":{"game":"arma3","name":"Arma 3","version":"1.58"},"arma3_since":"1.58","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":"Object or PositionAGL (especially on bridges) or Arma 3 v2.00 Position2D","optional":false,"default":null,"description":"array, in which case Z will be automatically deduced as the height of the road surface","types":["Object","PositionAGL","Position2D"],"since":null,"text":"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 surface"}],"returns":{"type":"Object","types":["Object"],"description":"road segment or objNull","text":"Object - road segment or objNull"},"form":"unary","operator":null,"left":null,"right":{"text":"position","types":["Object","PositionAGL","Position2D"]}}],"examples":[{"text":"```sqf\n_road = roadAt ASLToAGL getPosASL player;\n```","code":["_road = roadAt ASLToAGL getPosASL player;"]},{"text":"```sqf\n_isOnRoad = !isNull roadAt player;\n```","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]"]}],"multiplayer":null,"problems":null,"aliases":[],"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.\n\nIn order to get such segment use nearRoads.\n\n```sqf\n_closest_road = (_pos nearRoads 0.1) select 0;\n```"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Roads and Airports","Introduced with Arma 3 version 1.58","Scripting Commands"]}