The enemy can now kill the player on impact. Well, that's kind of one-sided, isn't it? The player needs a way to fight back! If only the player had some kind of weapon. Oh wait, they do! Let's make the player's bullets actually do something. However, we aren't going to edit the bullets, we're going to edit the enemy.
The enemy's Defense Collider object has a perfect size and position to also act as the collider that takes damage. This is a case where a collider can have multiple purposes. Let's add a new script that is specifically meant to accept damage from the player's weapon shots. Create a new script called
TakeDamageFromPlayerBullet and write it up as follows:
using UnityEngine; using System.Collections; public class TakeDamageFromPlayerBullet ...