{"name":"roadsConnectedTo","title":"roadsConnectedTo","type":"command","url":"https://community.bistudio.com/wiki/roadsConnectedTo","revid":369200,"updated":"2024-09-03T10:34:49Z","groups":["Roads and Airports"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Find the road segments connected to the given road segment.\n\n> [!IMPORTANT]\n> - Pedestrian roads such as `\"TRAIL\"`s are missing connection information by design, therefore the primary syntax will return empty array for those - use the alternative syntax to return pedestrian roads.\n> - Road connection is not bidirectional; e.g road segment Y can be connected to road segment Z, but road segment Z can lack a connection with road segment Y.","syntaxes":[{"syntax":"roadsConnectedTo roadSegment","params":[{"name":"roadSegment","type":"Object","description":"road segment","type_expr":"Object"}],"returns":{"type":"Array of Objects","type_expr":"Array<Object>","description":"connected road segments"},"form":"unary","right":{"text":"roadSegment"}},{"syntax":"roadsConnectedTo [roadSegment, extended]","since":"arma3 2.00","params":[{"name":"roadSegment","type":"Object","description":"road segment","type_expr":"Object"},{"name":"extended","type":"Boolean","optional":true,"default":"false","description":"when true, performs a more thorough search on top of base behaviour, slower but returns pedestrian and other missing road segments","type_expr":"Boolean","text":"extended: Boolean - (Optional, default false) when true, performs a more thorough search on top of base behaviour, slower but returns pedestrian and other missing road segments"}],"returns":{"type":"Array of Objects","type_expr":"Array<Object>","description":"connected road segments"},"form":"unary","right":{"text":"[roadSegment, extended]"}}],"examples":[{"code":["_road = (player nearRoads 50) select 0;\n_connectedRoads = roadsConnectedTo _road;"]},{"code":["_road = (player nearRoads 50) select 0;\n_connectedRoadsIncPedestrian = roadsConnectedTo [_road, true];"]}],"see_also":["nearRoads","isOnRoad","roadAt","surfaceIsWater","getRoadInfo","nearestTerrainObjects"]}