playMaker

Author Topic: Spawn Wave of Enemies  (Read 1145 times)

curb47

  • Sr. Member
  • ****
  • Posts: 256
Spawn Wave of Enemies
« on: September 22, 2020, 02:30:13 AM »
Hi there,

Can anyone point me in the direction of a tutorial that explains using Array Maker to set up waves of enemies to spawn?

I'm trying to set up a system that spawns a wave of 5 enemies depending on player actions, and at the moment my logic is amateurish at best, with 5 different Pooler Spawn actions for 1 enemy, spawning at 5 different game objects, grouped near each other, positioned in-world.

The same enemy spawns at the same place each time.

I'd like to have a system that spawns a wave of different enemies, in a group of 5. So I mean, wave 1 can be 5 x Enemy1 (robot), spawning at location 1.

It seems odd to me that the Pooler Spawn action doesn't give you the option of spawning more than 1 prefab, so I need a separate action for each individual prefab/enemy.

The information I guess I'd need stored in the array would be:

Different Enemy Prefabs

Spawn Points (different positions and groupings of 5 empty Game Objects)

Does this make sense?

Thanks.





LuminRabbit

  • Full Member
  • ***
  • Posts: 161
  • Lumin Rabbit
Re: Spawn Wave of Enemies
« Reply #1 on: November 10, 2020, 08:39:05 PM »
Im not sure I totally understand the question?

To spawn a wave of different enemies from the same spawn point I would probably state setup like:

State 1 - wait state
State 2 - Spawn state (from the first pool) and the only spawn point in the hierarchy
State 3 - wait state
State 4 - Spawn state (from the second pool) with the same spawn point as above.

I was initially thinking you could create a parent object that has five children but I don't think that would work as I don't know how you would despawn the child object one at a time.

Another option would be to activate and deactivate enemies as you want and just keep them in the scene and reset positions on them., I recently did something similar by activating/deactivating the object at a random position once colliding with a trigger (don't know if its something your interested in).

Im not experienced with this but hope it gave you some ideas I know that pooler is limited but awesome that its free ;)
« Last Edit: November 11, 2020, 09:31:02 AM by Kodagames »
Have I said how much I love playmaker!!! This is one amazing tool