Arma 3 Scripting

getRelDir

  • Global argument
  • Arma 3 v1.56

Command · Markdown · JSON · original wiki page

Description

Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of BIS_fnc_relativeDirTo. Taking the current direction of the object into account.

Syntax

object getRelDir position

Parameters:

Returns: Number

Examples

Example 1

_reldir = player getRelDir tank;

Example 2

// Set object's direction towards any given position
_object setDir (getDir _object + (_object getRelDir [_x, _y, _z]))

See also

getDir · direction · getDirVisual

Community notes

Tankbuster

To clarify, this returns a relative direction, so objects directly in front are said to be at zero degrees. So, taking example 1 above, if the tank is in front of the player, this function will return 0. If the tank is to the right of the player, it will return 90.