---
name: "camSetDir"
type: command
status: ok
groups: ["Camera Control"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/camSetDir
revid: 377244
updated: 2026-01-02T04:23:26Z
---

# camSetDir

*Command · Camera Control · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

Locality: arguments **local** · effect **local**

## Description

Sets the orientation of the given camera in the direction of the given vector. Needs [camCommit](../commands/camCommit.md). Since Arma 3 v0.50, only the second syntax with a [Vector3D](../topics/Vector3D.md) is available.

## Syntax

### Syntax 1

```sqf
camera camSetDir azimuth
```

**Parameters:**

- `camera`: [Object](../topics/Object.md) - object of type "camera"
- `azimuth`: [Number](../topics/Number.md) - camera azimuth

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

### Syntax 2

*since arma3 0.50*

```sqf
camera camSetDir direction
```

**Parameters:**

- `camera`: [Object](../topics/Object.md) - object of type "camera"
- `direction`: [Vector3D](../topics/Vector3D.md) - direction of camera. Must be a valid vector.

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

## Examples

### Example 1

Since Arma 3:

```sqf
private _pos1 = player modelToWorld [0, 5, 5];
private _pos2 = player modelToWorld [0, 50, 50];

private _cam = "camera" camCreate _pos1;
_cam cameraEffect ["INTERNAL", "BACK"];

_cam camSetPos _pos2;
_cam camSetDir (_pos2 vectorFromTo _pos1);
_cam camCommit 5;
waitUntil { camCommitted _cam };

_cam camSetPos _pos1;
_cam camCommit 5;
```

### Example 2

Before Arma 3:

```sqf
private _pos1 = player modelToWorld [0, 5, 5];
private _pos2 = player modelToWorld [0, 50, 50];

private _cam = "camera" camCreate _pos1;
_cam cameraEffect ["INTERNAL", "BACK"];

_cam camSetPos _pos2;
_cam camSetDir 180;
_cam camCommit 5;
waitUntil { camCommitted _cam };

_cam camSetPos _pos1;
_cam camCommit 5;
```

## See also

[direction](../commands/direction.md) · [setDir](../commands/setDir.md) · [camSetTarget](../commands/camSetTarget.md) · [getCameraViewDirection](../commands/getCameraViewDirection.md)

## Community notes

**Killzone_Kid** — 2016-05-09

[cameraEffect](../commands/cameraEffect.md) "INTERNAL" works better than "EXTERNAL" with this command.

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