How can I spawn different enemies in different levels?

Hello!

I’m making a survival twinstick shooter where character clear waves of enemies and after clearing a specified wave, he teleports to the next level.
As I want to have ~10 types of enemies, it’s crucial to introduce and spawn different types on each level.

In my GameMode blueprint I’ve got a simple spawn logic (pic.1)

What I want to do is to add variety of enemies for each level. For example, Level1 has EnemyType1, Level2 has EnemyType2 and EnemyType3.

Thank you!

I think you asked this before :slight_smile:

What you have there is fine, but you just need an array of alien types and an int level counter in there.

Make a new variable of type ‘array of actor’, in the details panel you click the + sign to add alien types:

In the first slot you can choose BP_Alien1
2nd slot BP_Alien2
etc

The in your BP code above, the spawn node, instead of having the alien type literally coded, just have a GET on the array of alien types. The index in the array is the game level you are on.

So you have: MyAlienArray → GET → [ level ] and connect that to the spawn command.

Here buddy, he’s more detail. I made a slight mistake, I told you to make the array of type Actor, I should have said ‘Actor class reference’. So it’s like this:

The main enemy counting loop looks like this:

And the spawn ( which also sets the Tag, so we know it’s an enemy ):

Hope that helps :slight_smile: