AI Mob Spawner

So what is happening is when NPC count in the scene reaches 5 the First_Spawner stops spawing, and when NPC count reaches 10, the second one stops too.

This is happening because you are using GetAllActorsOfClass in the scene (which is the same for both Spawners) and checking if it reached that MaxNpcCount variable.

So depending on what you need, there is different ways to fix it:

To make each Spawner spawn certain amount of NPC you may create AlreadySpawned int variable and increment it each time you spawn an NPC, then check if it reached MaxNpcCount.

To keep the level of spawned NPC in the level you just set “MaxNpcCount” to desired amount (in this case 15), this way both spawners will keep spawning NPCs until there are 15 of them on the map.

Hope this helps~ :slight_smile: