Child Spawners

With Triggered Spawners, there is a concept of Child and Parent Spawners you can use. If you wish to do things like the following, Child Spawners are worth a look:

     
  1. Would like things to spawn from more than one location during a single triggered event (OnBecameVisible etc). Maybe you want explosions to spawn from three different unrelated locations when a large enemy gets hit. Yes you can do this with Wave Offsets but think "more flexible".
  2.  
  3. Want to spawn complex patterns of things not otherwise possible with the Triggered Spawner controls.

 

The Triggered Spawners Example Scene has a Mothership prefab with 2 Launch Bay Child Spawners. One launches enemies left and one right.

 

Child Spawners Setup & Usage:

     
  1. Child Spawners and Parent Spawners both use the same script – Triggered Spawner V2. If you already have a Triggered Spawner set up, simply add a child prefab under it.
  2.  
  3. Add a Triggered Spawner V2 script to the child prefab.
  4.  
  5. In the Inspector, change Trigger Source for the Child Spawner to "Receive From Parent".
  6. Now all that’s left is to configure the event(s) on the Child Spawner that you want to spawn waves of prefabs. Note that Parent Spawners will trigger the same event type, when they are activated, on the Child Spawners. In other words, if the trigger event is activated on the Parent Spawner, it will then activate the same-named Trigger event on the Child Spawners (like TriggerEnter). So set up your events accordingly.

    Note: Child Spawners are not required to have a Renderer Component to spawn Visible event waves. They only need the Parent Spawner to have it. Same goes for any other normal dependency - just make sure the parent has it.
 

Other things to note:

     
  1. You can nest Child Spawners any number of levels deep. That’s where the real power of them comes into play.
  2.  
  3. If you uncheck Propagate Triggers in any Spawner, the Child Spawners will not spawn anything because they won't be notified. And so their Child Spawners, if any, won't be notified.