---
name: "BIS_fnc_spawnGroup"
type: function
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_spawnGroup
revid: 378466
updated: 2026-04-21T15:38:13Z
---

# BIS_fnc_spawnGroup

*Function · Object Manipulation · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Function which handles the spawning of a dynamic group of characters. The composition of the [group](../commands/group.md) can be passed to the function.
Alternatively, a number can be passed and the function will spawn that amount of characters with a random type.

> [!NOTE]
> **Before Arma 3** a side's Center must have been created before a group may be spawned either by using [createCenter](../commands/createCenter.md) or an editor placed (0% Probability of Presence is fine) unit of the appropriate side.

## Syntax

```sqf
[position, side, toSpawn, relPositions, ranks, skillRange, ammoRange, randomControls, azimuth, precisePos, maxVehicles] call BIS_fnc_spawnGroup
```

**Parameters:**

- `position`: [Array](../topics/Array.md) format [Position](../topics/Position.md) - group's starting position
- `side`: [Side](../topics/Side.md) - group's side
- `toSpawn` - can be one of:
  - [Array](../topics/Array.md) - list of character types (**only** viable option for the [civilian](../commands/civilian.md) side as no civilian groups are defined in config)
  - [Number](../topics/Number.md) - amount of characters to spawn
  - [Config](../topics/Config.md) - CfgGroups entry
- `relPositions`: [Array](../topics/Array.md) of [Position](../topics/Position.md)s (Optional, default `[]`) a list of relative positions
- `ranks`: [Array](../topics/Array.md) of [String](../topics/String.md)s/[Number](../topics/Number.md)s - (Optional, default `[]`) ranks (see [BIS_fnc_setRank](../functions/BIS_fnc_setRank.md)) - **must** be same size as *toSpawn*'s array
- `skillRange`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s - (Optional, default `[]`) skill range format [min, max]
- `ammoRange`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s - (Optional, default `[]`) ammunition range (0..1) format [min, max]
- `randomControls`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s - (Optional, default [-1, 1]) to format [minUnits, chance]:
  - minUnits: [Number](../topics/Number.md) - (Optional, default -1) amount of mandatory units
  - chance: [Number](../topics/Number.md) - (Optional, default -1) spawn chance for remaining units in range 0..1
- `azimuth`: [Number](../topics/Number.md) - (Optional, default 0) azimuth/[direction](../commands/direction.md)
- `precisePos`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) forces precise position placement
- `maxVehicles`: [Number](../topics/Number.md) - (Optional, default 10e10) vehicle number limit

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

## Examples

### Example 1

Spawn five random EAST units at aPosition:

```sqf
[getPosATL aPosition, east, 5] call BIS_fnc_spawnGroup;
```

### Example 2

Spawn a Stryker MGS Platoon at marker "tankSpawn":

```sqf
[getMarkerPos "tankSpawn", side player, (configFile >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] call BIS_fnc_spawnGroup;
```

### Example 3

Spawn a TK Militia Medic and Soldier at aPos facing south:

```sqf
[getPos aPos, east, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
```

## See also

Arma 2: CfgVehicles · Arma 3: Assets

## Community notes

**Snake Plissken** — 2016-08-23

Sides are as follow:
- [west](../commands/west.md)/[blufor](../commands/blufor.md) = BLUFOR
- [east](../commands/east.md)/[opfor](../commands/opfor.md) = OPFOR
- [resistance](../commands/resistance.md)/[independent](../commands/independent.md) = INDEPENDENT
- [civilian](../commands/civilian.md) = CIVILIAN.

To spawn one BLUFOR group ("MARK1" is the name given to a map marker):

```sqf
Group_Name_Here = [getMarkerPos "MARK1", WEST, ["B_G_Soldier_A_F", "B_G_Soldier_F", "B_G_Soldier_AR_F", "B_G_Soldier_LAT_F"]] call BIS_fnc_spawnGroup;
```

Or a random group OPFOR of seven units

```sqf
Group_Name_Here = [getMarkerPos "MARK1", EAST, 7] call BIS_fnc_spawnGroup;
```

an independent group:

```sqf
Group_Name_Here = [getMarkerPos "MARK1", INDEPENDENT, ["I_G_Soldier_A_F", "I_G_Soldier_F", "I_G_Soldier_AR_F", "I_G_Soldier_LAT_F"]] call BIS_fnc_spawnGroup;
```

---

**Cheitan** — 2017-08-02

When using this function for making a dynamic AI spawn, pay attention to the fact that none of the created groups will be marked for auto-deletion when the group become empty (all members dead). It means that it can be very easy to hit the 144 (288 for A3) max groups per side limitation, implying that no more AI or group can be created afterwards. To avoid this issue on Arma 3, don't forget to use [deleteGroupWhenEmpty](../commands/deleteGroupWhenEmpty.md) command in your script.

<sub>Source: [BI Community Wiki — BIS fnc spawnGroup](https://community.bistudio.com/wiki/BIS_fnc_spawnGroup) (revision 378466).</sub>
