Another way to easily pinpoint another gameobject that the enemy collides with

if (otherCollider.GetComponentInChildren<SpriteRenderer>().sprite.name.Contains("Gravestone"))

This works as it should but for some reason there is just a null reference that appears in the console.

Privacy & Terms