void OnCollisionStay2D(Collision2D other) { if (other.gameObject.tag == "Blob") { BlobData bd = other.gameObject.GetComponent <BlobData>(); bd.TakeDamage(); } }
void OnCollisionStay2D(Collision2D other) { if (other.gameObject.tag == "Blob") { BlobData bd = other.gameObject.GetComponent <BlobData>(); if (!eating && bd.team != my_bd.team) { eating = other.gameObject; } if (eating == other.gameObject) { bd.TakeDamage(); } } }