void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent <Player> () == null) //for player to pick up the candies { return; } lifeSystem.GiveLife(); Destroy(gameObject); }