void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Player")) { PointsManager.GetCookie(); Destroy(gameObject); } }