---
name: "playableUnits"
type: command
status: ok
groups: ["Multiplayer", "Object Detection"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/playableUnits
revid: 376985
updated: 2026-01-01T07:13:32Z
---

# playableUnits

*Command · Multiplayer, Object Detection · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Returns a list of playable units in a multiplayer game (occupied by both AI or players), created on the following sides [east](../commands/east.md)/[opfor](../commands/opfor.md), [west](../commands/west.md)/[blufor](../commands/blufor.md), [resistance](../commands/resistance.md)/[independent](../commands/independent.md) and [civilian](../commands/civilian.md) only.
Does not contain units of [sideLogic](../commands/sideLogic.md).

> [!NOTE]
> This command returns an empty array in Singleplayer; use [switchableUnits](../commands/switchableUnits.md) instead.

> [!IMPORTANT]
> This command does not include dead players awaiting for respawn.

## Syntax

```sqf
playableUnits
```

**Returns:** [Array](../topics/Array.md) of [Object](../topics/Object.md)s

## Examples

### Example 1

```sqf
{ _x groupChat "I'm a playable unit."; } forEach playableUnits;
```

### Example 2

```sqf
_playableInGroup = units group player arrayIntersect playableUnits;
```

### Example 3

```sqf
_nonPlayableInGroup = units group player - playableUnits;
```

## See also

[playableSlotsNumber](../commands/playableSlotsNumber.md) · [allPlayers](../commands/allPlayers.md) · [allCurators](../commands/allCurators.md) · [allGroups](../commands/allGroups.md) · [allDead](../commands/allDead.md) · [switchableUnits](../commands/switchableUnits.md) · [vehicles](../commands/vehicles.md) · [allUnitsUAV](../commands/allUnitsUAV.md) · [allDeadMen](../commands/allDeadMen.md) · [isPlayer](../commands/isPlayer.md) · [playersNumber](../commands/playersNumber.md)

## Community notes

**DreadedEntity** — 2014-12-23

To get a list of all player-controlled units:

```sqf
_allPlayers = [];
{
    if (isPlayer _x) then
    {
        _allPlayers pushBack _x;
    };
} forEach playableUnits;
```

---

**FR Starfox64** — 2015-08-16

[playableUnits](../commands/playableUnits.md) will not return dead players, use [allPlayers](../commands/allPlayers.md) instead.

---

**Pierre MGI** — 2017-02-14

Using the Editor (multiplayer attributes) for unchecking "enable AI", or disabling AI(s) in lobby, will make [playableUnits](../commands/playableUnits.md) as a public variable,  updated by each JIP on disabled slot.
So, if all slots are disabled AI, playableUnits is same as allPlayers

Furthermore, in this case, non-played slot (playable and disabled AI) units simply don't exist!

i.e. If you name 8 playable units: u1..u8, then 2 players in game: u3 & u6

playableUnits will return [u3,u6], and true for  isNil "u1", isNil "u2"... until another player takes the slot.

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