//this will check if it collided with the player void OnCollisionEnter(Collision other) { //this will check if the collider is the player if (other.gameObject.CompareTag("Player")) { Destroy(other.gameObject); Destroy(this.gameObject); generator.winFunctionGen(); // activateUI.SetActive(true); } }