Arma 3 Scripting

Function in Positions, Geometry

BIS_fnc_relPos

Also available as Markdown and JSON, or read the original wiki page.

Description

Returns a position that is a specified distance and compass direction from the passed position or object.

Note

Arma 3: In Arma 3 use getPos' alternative syntax instead.

Syntax

[origin, distance, direction] call BIS_fnc_relPos

Parameters:

Returns: Position

Examples

Example 1

[[0,0,0], 1000, 50] call BIS_fnc_relPos; // [766.044,642.788,0]

See also

getPos

Community notes

Lawman Actual

The function appears to work in two dimensions, and as such can be used to find the position of a target relative to the player if bearing and distance are known.

However, if there is a significant change in elevation between yourself and the target, the distance registered on a rangefinder (which is measuring in a 3-dimensional straight line) will always be larger than the two-dimensional value required for BIS_fnc_relPos and as such air-strikes and ordnance called in using such a function can miss by several hundred metres in extreme cases.

Currently searching for a method which incorporates the azimuth of the rangefinder in calculation.