---
name: "setVectorUp"
type: command
status: ok
groups: ["Math - Vectors"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setVectorUp
revid: 377596
updated: 2026-01-02T07:00:50Z
---

# setVectorUp

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

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

## Description

Set object's up vector. Direction of the object remain unchanged. Default object's [vectorUp](../commands/vectorUp.md) is [0,0,1].

## Syntax

```sqf
object setVectorUp vectorUp
```

**Parameters:**

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

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

## Examples

### Example 1

Turn object upside down:

```sqf
_obj setVectorUp [0, 0, -1];
```

### Example 2

Align object with the terrain underneath:

```sqf
_obj setVectorUp surfaceNormal getPosASL _obj;
```

## See also

[vectorDir](../commands/vectorDir.md) · [vectorUp](../commands/vectorUp.md) · [setVectorDir](../commands/setVectorDir.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)

## Community notes

**General Barron** — 2009-03-03

[setVectorUp](../commands/setVectorUp.md) can only influence an object's bank. It can not influence pitch. Example:

```sqf
player setVectorUp [0, 1, 0]
```

If the player is facing 0 degrees (north), then this will do NOTHING.

If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left.

---

**Kronzky** — 2007-03-22

An in-depth discussion on the concept of vectors is available [here](http://forums.bistudio.com/showthread.php?t=50914).

---

**Str** — 2008-03-16

Command can be also used to rotate camera in all three axis (which also mean it is possible to set camera bank).

---

**Killzone_Kid** — 2013-10-03

It is possible to change both pitch and bank of an object ([surfaceNormal](../commands/surfaceNormal.md) application for instance).
Assuming an ammo box in the following example is facing North (default direction is 0):

```sqf
_ammobox setVectorUp [0, 1, 0]; // box is pitched 90 degrees forward
_ammobox setVectorUp [1, 0, 0]; // box is banked 90 degrees to the right
```

However the above will stop working as soon as you attach the box to something. The following trick however will work in this case:

```sqf
_ammobox attachTo [player, [0, 2, 1]];
_ammobox setVectorUp [0, 0.99, 0.01]; // box is pitched ~90 degrees forward
_ammobox setVectorUp [0.99, 0, 0.01]; // box is banked ~90 degrees to the right
```

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