---
name: "getUnitState"
type: command
status: ok
groups: ["AI Behaviour"]
arma3_since: "2.18"
locality: {"argument": "local", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getUnitState
revid: 369978
updated: 2024-10-22T13:15:33Z
---

# getUnitState

*Command · AI Behaviour · Arma 3 v2.18*

Locality: arguments **local**

## Description

Returns current state of the given AI unit, which could be one of the following:
- "WAIT" - another plan is needed (current partial plan was done or is not present)
- "INIT" - operative planing should start, endpoint is set
- "INITFAILED" - init failed because data are not ready
- "BUSY" - operative plan ready and valid
- "OK" - completed whole strategic plan
- "DELAY" - repeat search, usually when failed
- "CARGO" - unit is in vehicle cargo, no planning needed
- "STOPPING" - unit is stopping (usually because of getin/getout request/landing)
- "REPLAN" - we have a plan, but we would like to search a new one
- "STOPPED" - unit is stopped, no planning needed (also landed. Different from [stop](../commands/stop.md) command)
- "PLANNING" - operative planning pending

## Syntax

```sqf
getUnitState unit
```

**Parameters:**

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

**Returns:** [String](../topics/String.md) - unit state (see description)

## Examples

### Example 1

```sqf
_state = getUnitState bob; //"WAIT"
```

## See also

[disableAI](../commands/disableAI.md) · [enableAI](../commands/enableAI.md) · [checkAIFeature](../commands/checkAIFeature.md) · [enableAIFeature](../commands/enableAIFeature.md) · [vehicleMoveInfo](../commands/vehicleMoveInfo.md) · [expectedDestination](../commands/expectedDestination.md)

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