Advertisement

Latest Plattforms Activity

frob
December 31, 2020 11:42 PM
NullReferenceException

This is a place to leverage your debugger.

foreach (Collider2D enemy in hitEnemies)

{
    enemy.GetComponent<EnemyHealth>().TakeDamage(attackDamage);
}

Most likely the collider being processed doesn't have an EnemyHealth component attached.

There are only a few other ways you could get the erro…

5,685 views
Advertisement
Advertisement
Advertisement