Spawning seperate types of enemys from arra / datatable

Hello! Can you check it without Delay?

First of all, the delay is set to 5 seconds from what I can see, I don’t know if that’s intentional or not, but it shouldn’t really effect the code. Second of all, are you trying to spawn the different enemies within the Spawner BP, or are you spawning one enemy that changes into the enemy you want. If you are spawning different enemies within the Spawner BP, you need to define the class you want in the “spawn AI from class” node. If you’re changing the enemy type within the enemy BP (or whatever is used for AI, I personally have never used AI), I think that we need to see that “setting variables” script.

Hi, I have a kinda problem with “for each loop”. Firstly, I will show you what I have, and then I tell you what I want to achieve.

348109-bpgraphscreenshot-2021y-09m-06d-17h-38m-51s-748-00.png

So, I have two data tables, one with enemies types where I have their statistics like hp etc.
And second one where Row Names are this same as Row names in the first one.
I want to first spawn all enemies of first type (which will be separated by 0.5 second delay), then spawn second type of enemies etc.
But for an unknown reason (at least for me) it spawns only the last type of enemies.
If someone knows how to resolve my problem or can provide me a link to some sort of tutorial in this matter, I would appreciate that!

You have a 5 second delay on the loop. Basically, loops ignore delays. If you have 10 enemy types in the table, you will get a 5 second delay, followed by the instantaneous spawning of all 10 types.

If you want to separate the spawning by a delay, you need to use an ‘if’ node and an index to got through the array:

348127-screenshot-1.jpg