---
name: "roadAt"
type: command
status: ok
groups: ["Roads and Airports"]
arma3_since: "1.58"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/roadAt
revid: 377838
updated: 2026-01-03T04:32:28Z
---

# roadAt

*Command · Roads and Airports · Arma 3 v1.58*

Locality: arguments **global**

## Description

Returns a road segment containing given position, [objNull](../commands/objNull.md) otherwise. Same as [isOnRoad](../commands/isOnRoad.md) only returns the actual road object instead of boolean.

## Syntax

```sqf
roadAt position
```

**Parameters:**

- `position`: [Object](../topics/Object.md) or [PositionAGL](../topics/Position.md#positionagl) (especially on bridges) or Arma 3 v2.00 [Position2D](../topics/Position.md#introduction) - array, in which case Z will be automatically deduced as the height of the road surface

**Returns:** [Object](../topics/Object.md) - road segment or [objNull](../commands/objNull.md)

## Examples

### Example 1

```sqf
_road = roadAt ASLToAGL getPosASL player;
```

### Example 2

```sqf
_isOnRoad = !isNull roadAt player;
```

### Example 3

For detecting bridges, for example:

```sqf
getModelInfo (roadAt ASLToAGL getPosASL player); // ["bridgesea_01_f.p3d", "a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d", true]
```

## See also

[nearRoads](../commands/nearRoads.md) · [roadsConnectedTo](../commands/roadsConnectedTo.md) · [isOnRoad](../commands/isOnRoad.md) · [surfaceIsWater](../commands/surfaceIsWater.md) · [getRoadInfo](../commands/getRoadInfo.md) · [nearestTerrainObjects](../commands/nearestTerrainObjects.md)

## Community notes

**OOKexOo** — 2016-12-30

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](../commands/nearRoads.md).

```sqf
_closest_road = (_pos nearRoads 0.1) select 0;
```

<sub>Source: [BI Community Wiki — roadAt](https://community.bistudio.com/wiki/roadAt) (revision 377838).</sub>
