isOnRoad: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 12: Line 12:
| '''isOnRoad''' position|SYNTAX=
| '''isOnRoad''' position|SYNTAX=


|p1= position: [[Object]] or [[Array]] in format [[PositionAGL]] (especially on bridges) |PARAMETER1=  
|p1= position: [[Object]] or [[Array]] in format [[PositionAGL]] (especially on bridges) or (since Arma 3 v1.99.146460) [[Position2D]], in which case Z will be automatically deduced as the height of the road surface |PARAMETER1=  


| [[Boolean]] |RETURNVALUE=  
| [[Boolean]] |RETURNVALUE=  

Revision as of 16:37, 9 June 2020

Hover & click on the images for description

Description

Description:
Checks if given position is inside road segment. Same as roadAt, only return is boolean instead of road object.
Groups:
Uncategorised

Syntax

Syntax:
isOnRoad position
Parameters:
position: Object or Array in format PositionAGL (especially on bridges) or (since Arma 3 v1.99.146460) Position2D, in which case Z will be automatically deduced as the height of the road surface
Return Value:
Boolean

Examples

Example 1:
_objOnRoad = isOnRoad player;
Example 2:
_posOnRoad = isOnRoad ASLToAGL getPosASL player;

Additional Information

See also:
nearRoadsroadsConnectedToroadAtsurfaceIsWater

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Posted on November 24, 2017 - 21:31 (UTC)
Tankbuster
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.