In this section, you'll set up the win and lose conditions for your game. When the enemy catches the player, the game should end and say "You lose." When the player collects all the collectibles, the enemy should stop chasing the player. Let's start by opening the player controller script in your preferred scripting editor. Add a new on collision enter function after the update function. When a collision is detected, you need to check if the collision object was the enemy. This can be done with the compare tag property. If the tag is enemy, the player game object should be destroyed. The win text object should also be activated and then updated to display the text "You lose." Save the script and return to the editor. Now you need to make sure that the enemy game object has the correct tag. Select the enemy body game object in the hierarchy. In the inspector, locate the tag dropdown and select create new tag. Click the plus icon to create a new tag and name it Enemy. Make sure the capitalization matches what you wrote in your code. Save the new tag. In the inspector, select the enemy body game object again and set its tag to the newly created Enemy tag. This step is crucial and should be set specifically on the EnemyBody. Run the game to test. Now when the enemy collides with the player, the player game object is destroyed, and the updated text displays "You lose." Finally, you want the enemy to stop chasing the player when the winning condition is achieved. Back in the player controller script, you already have a function named SetCountText that runs when the winning condition is met. All you need to do now is destroy the enemy game object as well. By adding this line in the SetCountText function, you can destroy the enemy game object. Notice that you are once again using the Enemy tag to find the correct object to destroy. Tags are a powerful way to find specific objects in a scene. Save the script, return to the editor, and run the game to test the win condition. When you collect all the coins, the enemy is destroyed. Congratulations! You have successfully set up the win and lose conditions for your game. You now have a simple complete game loop.