O'Reilly logo

Blueprints Visual Scripting for Unreal Engine by Brenden Sewell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting a gameplay win condition

One of the final steps we need to establish a full game loop is to create a condition for the player to win. To do so, we will modify our HUD and controller Blueprints to account for a target goal that the player must strive to hit.

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 TargetGoal. Make it an Integer variable type, ensure Editable is checked, and then set its default value to 2 for now.

Now that we have created a target goal, we should display this information to the player. Open the HUD Blueprint widget we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required