# How to set up Spawn system?

**URL:** <https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075>\
**Category:** AI\
**Tags:** expose-on-spawn, spawn-rate, unreal-engine, question\
**Created:** [March 10, 2021, 7:55pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075 "2021-03-10T19:55:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zarko122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zarko122](https://forums.unrealengine.com/u/Zarko122)\
**Post date:** [March 10, 2021, 7:55pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/1 "2021-03-10T19:55:09Z")

</div>

Hello, I want to set up that Ai spawn every 3 mins. Every wave the AI is stronger so basically it’s adding a little bit of health. Also I don’t need trigger box it just needs to randomly spawns across area. Thanks.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 11, 2021, 7:43am UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/2 "2021-03-11T07:43:08Z")

</div>

Pseudo code as the whole thing is probably beyond the scope of AH:

 ![332072-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/9/4593244796623459c913a4dc6dc0654f2554e584.jpeg)

Plenty of tuts on YT to spawn things in waves.

---

<div class="post-metadata">

**Author:** ![Zarko122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zarko122](https://forums.unrealengine.com/u/Zarko122)\
**Post date:** [March 11, 2021, 11:28am UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/3 "2021-03-11T11:28:30Z")

</div>

Very helpful! Also how can I manage the time so AI spawns for 2min then 1min pause, then again 2min and 1min pause and so on?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 11, 2021, 12:59pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/4 "2021-03-11T12:59:40Z")

</div>

> AI spawns for 2min then

This is unclear. You want to distribute the current spawn wave over a duration of 2 minutes so the enemies do not spawn all at once? And then wait for a minute?

* * *

> AI spawns for 2min then 1min pause

Otherwise spawning something every 2 mins and inserting a 1min pause does nothing. You might as well spawn every 3 mins.

---

<div class="post-metadata">

**Author:** ![Zarko122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zarko122](https://forums.unrealengine.com/u/Zarko122)\
**Post date:** [March 11, 2021, 1:31pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/5 "2021-03-11T13:31:22Z")

</div>

Well basically I need Ai to spawn during those 2 min and after that it will not spawn for 1 min. 1 min pause is where you build in the game to protect yourself for the next wave. Hope you understand. However if you have simpler solution I would like to hear it.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 11, 2021, 1:50pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/6 "2021-03-11T13:50:29Z")

</div>

> Hello, I want to set up that Ai spawn  
> every 3 mins

All right, so it’s not every 3 mins. It’s a duration over which the enemies spawn and then we pause. Rinse & repeat.

- decide how many enemies you want in a wave
- divide the wave duration by that number, getting N
- set that duration as Time in the timer - its event will fire and spawn every N seconds
- count spawned enemies
- once you’ve reached the amount you originally wanted, pause (or invalidate) the timer (that’s what the handle is for)
- count a minute (delay, tick, or another time)
- restart the whole thing from the top with new values

---

<div class="post-metadata">

**Author:** ![Zarko122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zarko122](https://forums.unrealengine.com/u/Zarko122)\
**Post date:** [March 11, 2021, 2:42pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/7 "2021-03-11T14:42:26Z")

</div>

Hmm I get what you saying. Forgive me I just started using UE. I stopped here, something is missing I’m not sure what but they keep spawning.

 ![332126-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/d/51d3a465ae8c0a2a27a617d89d91ec725740c296.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 11, 2021, 3:15pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/8 "2021-03-11T15:15:22Z")

</div>

No need to loop if we’re making them one by one. And you’d need to check how many there are after each spawn.

* * *

See if you can get this working:

 ![332132-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/a/9ea75001a2d5fd079105698b150d7f640b221eea.jpeg)

And you can select and copy / paste nodes from here to the graph (may need to clean it up a bit)

> **[SpawnWaves posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4](https://blueprintue.com/render/eua4oouv/)**
>
> No description provided

If it makes it any easier.

---

<div class="post-metadata">

**Author:** ![Zarko122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zarko122](https://forums.unrealengine.com/u/Zarko122)\
**Post date:** [March 11, 2021, 3:45pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/9 "2021-03-11T15:45:22Z")

</div>

It works. Thanks again!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 11, 2021, 3:53pm UTC](https://forums.unrealengine.com/t/how-to-set-up-spawn-system/480075/10 "2021-03-11T15:53:09Z")

</div>

Phew… good because I did not test this at all.
