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 information to the player. Open the HUD Blueprint widget we created under our UI folder. From the Designer view, find the Hierarchy panel. Drag two more Text objects from the Palette panel onto the Goal Tracker object in the Hierarchy panel. For the first text object, change the Text field to / , (including ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access