Game Development Reference
In-Depth Information
FigureĀ 10.22
Pick up objects
with visual
enhancements.
Now your players have an even greater chance of surviving their encounter with your
zombie. In the next and final section, you will even the playing field by allowing the zom-
bie to bring its friends to your scene.
Creating Hordes with Zombie Spawners
Zombie apocalypses usually contain more than one zombie, so you will want your game
to have just as many lurching undead. Instead of manually placing enemies around your
level, you can dynamically create zombie characters with spawners and triggers.
1. If it is not already open, open your Unity project and scene.
2. Create two empties, one called ZombieTrigger and one called ZombieSpawner .
3. Add a box collider to ZombieSpawner . Create a new script called ZombieSpawner.js
in your Scripts folder and type the following into it. Note that this script has two
boolean variables attached to it, invade and canShoot . invade allows the script to be
Search WWH ::




Custom Search