---
name: "vectorDir"
type: command
status: ok
groups: ["Math - Vectors"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/vectorDir
revid: 377247
updated: 2026-01-02T05:27:32Z
---

# vectorDir

*Command · Math - Vectors · Arma 3 v0.50 · introduced in Operation Flashpoint: Elite v1.00*

Locality: arguments **global**

## Description

Returns an object's direction vector in world space.

> [!IMPORTANT]
> The vector is **not necessarily [normalized](../commands/vectorNormalized.md)**. The [magnitude](../commands/vectorMagnitude.md) of the vector depends on the [object's scale](../commands/getObjectScale.md).

For an object facing one of the cardinal directions on perfectly flat ground (parallel to the XY-plane of the world space), [vectorDir](../commands/vectorDir.md) returns simple values:
- `[0, 1, 0]` if the object is facing directly north
- `[1, 0, 0]` if the object is facing directly east
- `[0, -1, 0]` if the object is facing directly south
- `[-1, 0, 0]` if the object is facing directly west

## Syntax

```sqf
vectorDir object
```

**Parameters:**

- `object`: [Object](../topics/Object.md)

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

## Examples

### Example 1

```sqf
_vecDir = vectorDir MyObject;
```

## See also

[vectorModelToWorld](../commands/vectorModelToWorld.md) · [vectorDirVisual](../commands/vectorDirVisual.md) · [vectorSide](../commands/vectorSide.md) · [vectorSideVisual](../commands/vectorSideVisual.md) · [vectorUp](../commands/vectorUp.md) · [setVectorDir](../commands/setVectorDir.md) · [setVectorUp](../commands/setVectorUp.md) · [setVectorDirAndUp](../commands/setVectorDirAndUp.md) · [vectorDiff](../commands/vectorDiff.md) · [vectorAdd](../commands/vectorAdd.md) · [vectorMultiply](../commands/vectorMultiply.md) · [vectorCrossProduct](../commands/vectorCrossProduct.md) · [vectorDistance](../commands/vectorDistance.md) · [vectorMagnitudeSqr](../commands/vectorMagnitudeSqr.md) · [vectorDistanceSqr](../commands/vectorDistanceSqr.md) · [vectorCos](../commands/vectorCos.md) · [vectorMagnitude](../commands/vectorMagnitude.md) · [vectorDotProduct](../commands/vectorDotProduct.md) · [vectorNormalized](../commands/vectorNormalized.md) · [vectorFromTo](../commands/vectorFromTo.md) · [BIS_fnc_transformVectorDirAndUp](../functions/BIS_fnc_transformVectorDirAndUp.md)

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