> For the complete documentation index, see [llms.txt](https://docs.infimagames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infimagames.com/product/low-poly-shooter-pack/guides-and-faq/overview/getting-started/how-to-spawn-ai-enemies-in-a-custom-map.md).

# How to Spawn AI Enemies in a Custom Map

***

**In this guide we're going to walk through the steps of adding the LPSP AI enemies to a custom map.**

* The first step is to add a **Nav Mesh Bounds Volume** to the map. This will determine the area that the AI enemies can spawn and move around within.

<div align="left"><figure><img src="/files/0pUdDAjYALmU3olMSRva" alt=""><figcaption></figcaption></figure></div>

* Let's scale it up quite a lot, so that they have enough room to move around in the map.

<div align="left"><figure><img src="/files/JwP9lbXlDQXI5C1qIjJC" alt=""><figcaption></figcaption></figure></div>

* Next we need to add the **BP\_LPSP\_AI\_Spawner** blueprint actor to the map, this is what will actually spawn the AI enemies.
* It is located here:\
  **InfimaGames > LowPolyShooterPack > Core > AI**
* We can simply drag and drop it into the map.

<div align="left"><figure><img src="/files/UEIIVWQn04RTlAalrGg9" alt=""><figcaption></figcaption></figure></div>

* We also need to add one or more spawn points to determine where the AI can actually spawn.&#x20;
* Drag **BP\_LPSP\_AI\_Spawn\_Point** into the map, feel free to place out a few of these (just make sure they're not clipping through the ground).

<div align="left"><figure><img src="/files/VDQf1IB6jQRy2d9jGIfP" alt=""><figcaption></figcaption></figure></div>

* Here's what it looks like now:

<div align="left"><figure><img src="/files/60HkqmG7ZIifD70q9J1D" alt=""><figcaption></figcaption></figure></div>

* Now we need to decide how many AI enemies we want to be spawned.

<div align="left"><figure><img src="/files/jaWkY5Qs5g0fY9i3msqd" alt=""><figcaption></figcaption></figure></div>

* We can modify that by changing the **Amount** value on the spawner blueprint actor.

{% hint style="info" %}
Spawning a lot of enemies will affect performance negatively, so try to keep the amount reasonable.
{% endhint %}

<div align="left"><figure><img src="/files/EZAyuBafDNUKdKE8Ygos" alt=""><figcaption></figcaption></figure></div>

* If we play now, we can see that the enemies have spawned in the map, and are spread out across the spawn locations. \
  \
  However, they are not moving around, this is because we haven't added any interest points for them to patrol between yet.

<div align="left"><figure><img src="/files/gPFD9lNqatMmNsmgv5Nj" alt=""><figcaption></figcaption></figure></div>

* So let's do that now, go back to the folder and drag a few **BP\_LPSP\_AI\_Interest\_Point** actors into the map.

<div align="left"><figure><img src="/files/13Jq1Os8FppkinuBIzXF" alt=""><figcaption></figcaption></figure></div>

* Place them out with some distance between them, these are basically the world space points that the AI enemies will "patrol" between.&#x20;

<div align="left"><figure><img src="/files/VWjdXTtwlRWPlfuJOWBY" alt=""><figcaption></figcaption></figure></div>

* If we play again, we can see that the AI enemies are moving around as expected!

<figure><img src="/files/D2jeORwkh5kC5PTyfSXD" alt=""><figcaption></figcaption></figure>

<div align="left"><figure><img src="/files/iqFh4DfeOqGhEE5Ikcop" alt=""><figcaption></figcaption></figure></div>

***


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.infimagames.com/product/low-poly-shooter-pack/guides-and-faq/overview/getting-started/how-to-spawn-ai-enemies-in-a-custom-map.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
