> For the complete documentation index, see [llms.txt](https://wiki.thescriptersguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.thescriptersguild.com/forge/nav-mesh/npc-units/ai/ai-spawning.md).

# AI Spawning

Campaign AI units are placed in a map using AI Spawners. In order for the AI units to spawn, the boundary of the object must intersect a nav mesh. Depending on the type of AI Spawner being used, one to many campaign AI Units can be spawned at a time via droppod, Phantom, or in-place. A maximum of 32 AI units can be spawned at a time.

## Scripting

AI Spawners and AI Vehicle Spawners are designed to be initialized to spawn AI units at a single location. Once the first squad has spawned, these two AI Spawners will only be able to spawn AI units at the original location, even if the object itself has been moved in a script. In order to spawn AI units at different locations, the spawner must be deleted, spawned, positioned and initailized again via script before being used.

To perform the initialization, a *Wait For N Seconds* node can be used with its parameter set to 0 seconds. This one frame delay will allow the engine to properly initialize the AI Spawner in its new position before it is used.

## Nodegraph Reference

{% content-ref url="/pages/pl2Uxk054hS1ROf8PJ7H" %}
[Trigger AI Spawner](/scripting/nodes/ai/trigger-ai-spawner.md)
{% endcontent-ref %}

{% content-ref url="/pages/yTHcC2mABAQCNptRKTw2" %}
[Get Squad Definition From AI Spawner](/scripting/nodes/ai/get-squad-definition-from-ai-spawner.md)
{% endcontent-ref %}

{% content-ref url="/pages/TeVGF8c37zidtf2hioLw" %}
[Get All AI Spawners](/scripting/nodes/ai-advanced/get-all-ai-spawners.md)
{% endcontent-ref %}

{% content-ref url="/pages/M3zvb6TRRJaEeRB29E7N" %}
[Get Squads From Spawner](/scripting/nodes/ai-advanced/get-squads-from-spawner.md)
{% endcontent-ref %}

**Contributors**

Mr. Admirals\
Cookies


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.thescriptersguild.com/forge/nav-mesh/npc-units/ai/ai-spawning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
