---
name: "BIS_fnc_weaponDirectionRelative"
type: function
status: ok
groups: ["Weapons"]
arma3_since: "1.64"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_weaponDirectionRelative
revid: 339146
updated: 2023-04-26T10:55:04Z
---

# BIS_fnc_weaponDirectionRelative

*Function · Weapons · Arma 3 v1.64*

## Description

Returns relative direction vector of given weapon for the given vehicle

## Syntax

```sqf
[vehicle, weapon, visual] call BIS_fnc_weaponDirectionRelative
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md) - vehicle
- `weapon`: [String](../topics/String.md) - vehicle weapon
- `visual`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) if [true](../commands/true.md) - result is in render scope, [false](../commands/false.md) - simulation scope

**Returns:** [Array](../topics/Array.md) format [Vector3D](../topics/Vector3D.md)

## Examples

### Example 1

```sqf
private _relweapondir = [tank, "cannon_105mm"] call BIS_fnc_weaponDirectionRelative;
```

## See also

[BIS_fnc_attachToRelative](../functions/BIS_fnc_attachToRelative.md) · [BIS_fnc_vectorDirAndUpRelative](../functions/BIS_fnc_vectorDirAndUpRelative.md) · [weaponDirection](../commands/weaponDirection.md)

<sub>Source: [BI Community Wiki — BIS fnc weaponDirectionRelative](https://community.bistudio.com/wiki/BIS_fnc_weaponDirectionRelative) (revision 339146).</sub>
