---
name: "setFormDir"
type: command
status: ok
groups: ["Groups"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setFormDir
revid: 379378
updated: 2026-10-30T23:58:32Z
---

# setFormDir

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

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

## Description

Sets group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overridden by movement direction. If the new direction is noticeably different from the old direction (approx +/- 15 degrees), units will change positions changing [formationDirection](../commands/formationDirection.md).

## Syntax

```sqf
group setFormDir heading
```

**Parameters:**

- `group`: [Object](../topics/Object.md) or [Group](../topics/Group.md)
- `heading`: [Number](../topics/Number.md)

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

## Examples

### Example 1

```sqf
_group1 setFormDir 180;
```

### Example 2

```sqf
_unit1 setFormDir random 360;
```

### Example 3

```sqf
//center the main turret
(group BIS_Crew1) setFormDir (getDir BIS_Armor);
```

## See also

[setDir](../commands/setDir.md) · [setVectorDir](../commands/setVectorDir.md) · [setVectorDirAndUp](../commands/setVectorDirAndUp.md) · [resetSubgroupDirection](../commands/resetSubgroupDirection.md) · [formation](../commands/formation.md) · [formationLeader](../commands/formationLeader.md) · [formationMembers](../commands/formationMembers.md) · [formationTask](../commands/formationTask.md) · [formationDirection](../commands/formationDirection.md) · [formationPosition](../commands/formationPosition.md)

## Community notes

**Killzone_Kid** — 2014-11-22

When applied to AI, [setFormDir](../commands/setFormDir.md) will set unit formation direction, which in turn will force unit to change direction to match formation direction, however unit will stop turning as soon as unit direction is +/- 30 degrees of the formation direction. To precisely match formation direction, additional [setDir](../commands/setDir.md) is required:

```sqf
_unit setFormDir 45;
_unit setDir 45;
hint str direction _unit; //45
```

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