Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.23

Description

Description:Checks whether the given position or unit / vehicle is on the road. For the command to return true, the checked position has to be no more than 50cm above the road surface.

Syntax

Syntax:isOnRoad position
Parameters:
  • position: Object or PositionAGL - Unit, vehicle, or position (does not work with static objects).
Return Value:Boolean - Returns true, if on the road, false otherwise.

Alternative Syntax

Syntax:isOnRoad [position, considerSnow] (V3.3+)
Parameters:
  • position: Object or PositionAGL - Unit, vehicle, or position (does not work with static objects).
  • considerSnow: Boolean - If true, then roads are still recognized, even under a thick layer of snow.
Return Value:Boolean - Returns true, if on the road, false otherwise.

Examples

Examples:
_offRoad = !(isOnRoad _myLandy)
_onSnowyRoad = isOnRoad [getPos player, true]

Additional Information

See also: nearRoads, roadsConnectedTo, isTouchingWater, surfaceType
Multiplayer: 
Problems: 

Notes