---
name: "fleeing"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/fleeing
revid: 349082
updated: 2023-11-08T14:47:23Z
---

# fleeing

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

Locality: arguments **global**

## Description

Checks if a unit is fleeing.

Notes:
- Fleeing only affects AI led groups.
- Only the group as a whole can flee (or not).
- The courage of the AI group is based on the group's leader courage subskill.
- Each group has a max strength (summed "armor" of all infantry units - plus armor when inside vehicles).
- If the group losses by injury/damage or death/destruction are higher than the max strength, multiplied by leader's courage or [allowFleeing](../commands/allowFleeing.md) level , then the group will start fleeing.
- As result primarily the AI flees to a nearby "supply point" (some friendly units - preferably with medic or engineer, or a vehicle with repair/ammo/fuel cargo). Alternatively it will try to find a safe position within a 600m radius from the initial waypoint (danger, distance, amount of cover positions are taken into account).
- After the fleeing has been finished the group's initial strength is reset.
- Fleeing units in [combatMode](../commands/combatMode.md) red, will be set to yellow when fleeing to avoid engaging enemies while doing so.
- While fleeing, the group leader will be set to green, to avoid giving engage or fire orders, unless in [combatMode](../commands/combatMode.md) blue already. Also [speedMode](../commands/speedMode.md) is set to full.
- When reaching their flee point/destination, they will change to [combatMode](../commands/combatMode.md) yellow and [speedMode](../commands/speedMode.md) normal.
- With [allowFleeing](../commands/allowFleeing.md) one can make unit's flee earlier (or essentially never flee). Apply it, overrides the courage subskill influence.

## Syntax

```sqf
fleeing unit
```

**Parameters:**

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

**Returns:** [Boolean](../topics/Boolean.md) - returns [true](../commands/true.md) if a unit is fleeing, [false](../commands/false.md) if not. **Dead** or **empty** units return [false](../commands/false.md).

## Examples

### Example 1

```sqf
if (fleeing soldier_1) then {player sideChat "We have won!"} else {player sideChat "Keep fighting!"};
```

## See also

[allowFleeing](../commands/allowFleeing.md)

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