---
name: "isOnRoad"
type: command
status: ok
groups: ["Roads and Airports"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/isOnRoad
revid: 377415
updated: 2026-01-02T06:45:20Z
---

# isOnRoad

*Command · Roads and Airports · Arma 3 v0.50 · introduced in Arma 2 v1.00*

Locality: arguments **global**

## Description

Checks if given position is inside road segment. Same as [roadAt](../commands/roadAt.md), only return is boolean instead of road object.

## Syntax

```sqf
isOnRoad 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), in which case Z will be automatically deduced as the height of the road surface

**Returns:** [Boolean](../topics/Boolean.md)

## Examples

### Example 1

```sqf
_objOnRoad = isOnRoad player;
```

### Example 2

```sqf
_posOnRoad = isOnRoad ASLToAGL getPosASL player;
```

## See also

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

## Community notes

**Tankbuster** — 2017-11-24

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.

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