My Project 10: Zombie Spawners
Updated: Apr 30, 2021
To make sure that zombies are evenly distributed across the map, I chose to create several spawn locations that work throughout the game to replenish and spawn/despawn zombies as and when the player comes within their active area.
Zombies that are spawned within these areas are set to patrol within the designated spawn area. Seen individually as red spheres in the image above. They are then triggered active or inactive based on whether the player has entered a sphere trigger, indicated by the green lines seen in the image below. The main benefit of this system is to increase performance as only certain zombies are active at any given time, so less Ai is running.
Zombies that die are permanently dead on the map though have all scripts running on them disabled. The spawner then begins a new spawn process to replenish zombies over time once the player has left the area, being cancelled if they return.
To control and edit each spawner with ease I setup a system in the inspector seen below.
Thanks for reading!