One of the final steps we need in order to establish a full game loop is to create a condition for the player to win. To do so, we will modify our HUD Blueprint and controller Blueprints to account for a target goal that the player must strive to hit.
Setting a gameplay win condition
Displaying a target goal in the HUD
First, we need to create a variable that will establish how many targets we are asking the player to destroy in order to achieve a win. Open up the FirstPersonCharacter Blueprint and create a new variable called Target Goal. Make it an Integer variable type, ensure Instance Editable is checked, and then set its default value to 2 for now.
Now that we have created a Target Goal variable, we should display this...