---
name: "setBehaviour"
type: command
status: ok
groups: ["Groups", "AI Behaviour"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setBehaviour
revid: 364537
updated: 2024-05-16T20:46:45Z
---

# setBehaviour

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

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

## Description

Sets individual unit behaviour **on every unit in a group**.

> [!IMPORTANT]
> This command doesn't set AI [Group](../topics/Group.md) behaviour, see [setCombatBehaviour](../commands/setCombatBehaviour.md) or [setBehaviourStrong](../commands/setBehaviourStrong.md) for this.

> [!NOTE]
> See AI Behaviour for details of the effect of this command on AI units.

| Command | Applies To |
|---|---|
| [setBehaviour](../commands/setBehaviour.md) | **Every unit** in the group, but **not the group** itself |
| [setBehaviourStrong](../commands/setBehaviourStrong.md) | **Every unit** in the group, and the **group** itself |
| [setCombatBehaviour](../commands/setCombatBehaviour.md) | If argument is [Object](../topics/Object.md), only that **unit**, and if argument is [Group](../topics/Group.md), the **group** itself (not its units) |

## Syntax

```sqf
groupOrUnit setBehaviour behaviour
```

**Parameters:**

- `groupOrUnit` : [Group](../topics/Group.md) or [Object](../topics/Object.md) - unit or a [group](../commands/group.md)
- `behaviour`: [String](../topics/String.md) - can be one of:
  - "CARELESS"
  - "SAFE"
  - "AWARE"
  - "COMBAT"
  - "STEALTH"

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

## Examples

### Example 1

```sqf
_group1 setBehaviour "SAFE";
```

## See also

[setCombatBehaviour](../commands/setCombatBehaviour.md) · [combatBehaviour](../commands/combatBehaviour.md) · AIBehaviour · [behaviour](../commands/behaviour.md) · [setBehaviourStrong](../commands/setBehaviourStrong.md) · [setWaypointBehaviour](../commands/setWaypointBehaviour.md) · [combatMode](../commands/combatMode.md) · [setCombatMode](../commands/setCombatMode.md) · [skill](../commands/skill.md) · [setSkill](../commands/setSkill.md) · Arma 3: AI Skill

## Community notes

**SNKMAN** — 2009-01-03

Warning! Since Armed Assault v.1.14 the command setBehaviour "COMBAT" does not work correctly any longer.
Units ( Groups ) which are using this behaviour and then get a move order will not move to the given position.

---

**MadRussian** — 2010-02-14

Although setBehaviour can be called on an individual unit, the entire group will be affected.

---

**MulleDK13** — 2010-11-22

If setting a behaviour on an individual unit is required, it can be achieved by creating a temporary group, use joinSilent to make the individual unit belong to that group, then change his behaviour, use joinSilent into the original group, then delete the temporary group.

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