private void OnTriggerEnter2D(Collider2D collision) { //If the player enters the bounds of the heart, restore health to the player and destroy the heart if (collision.gameObject.CompareTag("Player")) { Shield = collision.gameObject.GetComponent <HealthScript>(); Shield.ActivateSheild(); Destroy(gameObject); } }