diff --git a/Assets/Scripts/Entity.cs b/Assets/Scripts/Entity.cs index bd6ea0d..cbeff89 100644 --- a/Assets/Scripts/Entity.cs +++ b/Assets/Scripts/Entity.cs @@ -29,7 +29,10 @@ public class Entity : MonoBehaviour protected virtual void Attack(){ // jason: TODO Either have target be Entity instead of transform, or skip Attack when GetComponent() is null Entity targetEntity = target.GetComponent(); - bool isTargetAlive = targetEntity.TakeDamage(attackDmg); + if(targetEntity != null){ + bool isTargetAlive = targetEntity.TakeDamage(attackDmg); + } + } protected virtual void SpecialAttack(){