Do a number of times

The for loop that you are using is exactly that, it is doing doing a thing a number of times. I don’t really understand the problem, can you be a little more specific? I get that you are trying to spawn waves of enemies. But, what happens when you hit play or when this spawning event gets executed? Do the enemies spawn or not?

I am looking for a BP node that will do a thing a number of times. like a wave spawns, I want it to do something a number of times in which I can control from an array

I have an array, and it is an integer and I want something to repeat a number of times based on the index I tell it to use. by form of doing this is wrong and I cant find any way of fixing this.

Video:

Here is a picture;

Thanks in advance!

1 Like

You should print the value of your OnWave variable. As it is correctly indexing the array to achieve your result.

You can print the result of the length of the array to verify you have the items.
You can call is valid index using your OnWave variable and if it fails you can print the result of that.

I have a button that I press that executes the wave spawning, my problem is that It will only spawn one enemy for every time I press the button. I want it to spawn the set amount in the index it is referencing.
that was my fault for not addressing the Issue I was having. Sorry.

Here is a link to a video of me showing off what is done. and what I need to find out how to fix.

SOLVED!
the problem was I was previously putting the +1 to the on wave variable in the loop body. another reason was that the spawn where conflicting with it making it impossible to spawn the rest of the AI in that wave.