private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.CompareTag("Player")) { parentScript.HitPlayer(collision); } }