How do I make bots spawn continuously

Hi, I’m working on a level and I want my bots to continue spawning while the level is active, but stop once a certain amount have spawned, but then spawn more once bots die so there is almost always the same amount of bots in the level.

And I want them to also spawn randomly from target points set up in the level. I have managed to set up some target points but when the spawn event starts a bot spawns at each point at the same time. this wouldn’t be so bad if I had the rest working to keep spawning new bots.

Any help would be greatly appreciated, I know this is probably something really simple that I’m missing, but I just can’t seem to find anything.

The way i had gone about this, is going into the level blueprint of the world you want them to spawn, and dragging off event tick, if you want some time before they spawn put a delay first then, use spawn actor from class functions so every frame the actors are spawn, which gets overwhelming so i suggest using a delay

To make them randomly spawn you get “actor location” then drag off that and get “random float in range” and plug that into a the vector location, i usually use 1-800, you make integer variables for the spawn limiting, like “current wave” “amount spawned” “max per wave” and use truenor false statements to judge whether they should continue spawning, " if amount killed is equal to or greater than maxperwave then dont spawn if true, set amount spawned and amount killed back to zero and current wave to current wave plus 1.

Im sorry i read your question about random spawn points incorrectly, i havent set something like that up yet but i would go in the direction of using a get random integer in range and have it be set from 0-how everany spawn points you have and have it randomly select one of them

Sure ill take one as soon as im able to

hey thanks for helping. can you show me a screenshot of how you do the spawn limiting? i cant quite figure it out without a graphic of some kind.

thanks so much :slight_smile:

So, you need 3 Integer Variables, i named mine, “Enemies Spawned” “MaxEnemiesperWave” and “WaveNumber” in the beginning of the event tick i set enemies spawned to however are spawning in each tick, so if you have 6 spawning every tick like i do, then set enemies spawned to 6 every time, and then i have a branch true or false statement, if the amount spawned is equal to max amount then, set next wave which is when i set the enemies spawned back to 0, increase the allocated amount per wave, and set wave number to “wave number + 1” i also add a 40 second delay because i want to give the player some time to kill the remaining enemies before more are going to be spawned, but if its false and the max amount is not reached yet then you drag off the false pin and hook up your spawners. be sure when you do the true or false you use >= and not == because if you spawn more than the allocated amount on == then the event will not register because its not perfectly equal, i hope this helps and if you have any more questions feel free to ask, i’m not a pro and this isn’t the only way to do it, this is just how i managed to.