{"name":"isOnRoad","operator":null,"title":"isOnRoad","type":"command","url":"https://community.bistudio.com/wiki/isOnRoad","revid":377415,"updated":"2026-01-02T06:45:20Z","groups":["Roads and Airports"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Checks if given position is inside road segment. Same as roadAt, only return is boolean instead of road object.","syntaxes":[{"syntax":"isOnRoad position","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":null,"optional":false,"default":null,"description":"Object or PositionAGL (especially on bridges) or Arma 3 v2.00 Position2D, 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, in which case Z will be automatically deduced as the height of the road surface"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"unary","operator":null,"left":null,"right":{"text":"position","types":["Object","PositionAGL","Position2D"]}}],"examples":[{"text":"```sqf\n_objOnRoad = isOnRoad player;\n```","code":["_objOnRoad = isOnRoad player;"]},{"text":"```sqf\n_posOnRoad = isOnRoad ASLToAGL getPosASL player;\n```","code":["_posOnRoad = isOnRoad ASLToAGL getPosASL player;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["nearRoads","roadsConnectedTo","roadAt","surfaceIsWater","getRoadInfo","nearestTerrainObjects"],"notes":[{"user":"Tankbuster","date":"2017-11-24T21:31:00Z","text":"Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad."}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Roads and Airports","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}