Game Development Reference
In-Depth Information
Figure 8-7. The projectiles without the use of gravity
5.
Turn the Gravity back on in the prefab.
6.
Stop Play mode.
About now you are probably itching to try out the new projectiles on the zombie bunnies. Let's
activate them and see how it goes.
1.
Locate the Zombie Spawn Manager and Zombie Zone object in the Garden
1 group, and activate them in the Inspector.
2.
Click Play, and try your hand at shooting the pesky critters.
They bounce up a little when you hit them, giving some visual feedback for your efforts. This is
due to the rigidbodies on both the zombie bunny and the projectile. You could get more bounce by
decreasing the critter's Mass, but you will soon be replacing them with a “dead replacement,” which
will be a different object altogether. Let's work on the script that will remove the hit zombie bunnies
from the scene first. The simplest solution will be to destroy them directly on collision. You will
require a tag for the projectile so they won't be destroyed on colliding with the ground or each other.
3.
At the top of the Inspector, click the Tag drop-down menu and select Add Tag.
4.
In the blank Element 1 field, type Ammo (Figure 8-8 ).
 
Search WWH ::




Custom Search