//Jimmy Vegas Unity Tutorials //This script will give your zombie health using System.Collections; using System.Collections.Generic; using UnityEngine; public class ZombieDeath : MonoBehaviour { public int EnemyHealth = 20; public GameObject TheEnemy; public int StatusCheck; void DamageZombie (int DamageAmount) { EnemyHealth -= DamageAmount; } void Update () { if (EnemyHealth <= 0 && StatusCheck == 0) { StatusCheck = 2; TheEnemy.GetComponent().Stop("walk"); TheEnemy.GetComponent().Play("back_fall"); } } }