---
name: "getRelDir"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "1.56"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getRelDir
revid: 364385
updated: 2024-05-12T02:06:56Z
---

# getRelDir

*Command · Object Manipulation · Arma 3 v1.56*

Locality: arguments **global**

## 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](../functions/BIS_fnc_relativeDirTo.md).
Taking the current [direction](../commands/direction.md) of the object into account.

## Syntax

```sqf
object getRelDir position
```

**Parameters:**

- `object`: [Object](../topics/Object.md)
- `position`: [Object](../topics/Object.md), [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction)

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

## Examples

### Example 1

```sqf
_reldir = player getRelDir tank;
```

### Example 2

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

## See also

[getDir](../commands/getDir.md) · [direction](../commands/direction.md) · [getDirVisual](../commands/getDirVisual.md)

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