Triggering a win
The final step for us is to determine the conditions that will result in the End Game custom Event being triggered. We want the Event to happen once the player has killed a sufficient number of target Cylinders to meet the target goal. We can evaluate this each time a target is destroyed. To do so, open CylinderTarget_Blueprint in the Blueprints folder and navigate to the end of the Blueprint chain in Event Graph.
We want to create a Branch node that will allow us to check if the last destroyed target was the last one needed to reach the goal. Attach a Branch node to the SET Target Kill Count node near the end of the chain. You can reattach the DestroyActor node to the False output of the Branch node.
Now we need to establish ...
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