Loop through each index of array then perform action for each

eleine.11
Fri, 04 Aug 2023 11:22:08 +0000
Blueprint

Hello!
I just started learning UE and I ran into a problem following some tutorial (UE5.1 ver).

I have a Data Table for enemy waves (rows) containing different enemy types, each having a class and a number. The table row looks like this: (Imgur: The magic of the Internet)

After I get the wave row, I want to go through each index and spawn the specified number of enemies of that class. At the moment, the event looks like this:

In the SpawnEnemies event I also have a 1s delay for each spawn.
It kinda works, but not quite. It simultaneously spawns 1 of each of the two enemy types, then continues to spawn the correct number for the second type.

I’ve been trying to fix it with no success. I’m guessing I have to get each index and then run the loop for each index, but can’t figure out how to do it properly… Can anyone help?

13 posts - 4 participants