How can I track AI's death?
How can I make it so when my 3 AI's die (Health integer gets to 0) the level simply restarts or loading another level.
asked Mar 14 '17 at 02:43 AM in Using UE4
Try something similar to what's in the picture provided. For this example I declared the function within the Player Character's Blueprint, which is named FirstPersonCharacter.
To give this functionality for your needs, you'll need to call this function before the AI is dead from the AI's blueprint using a cast to the player character's blueprint. The cast can be done by "Getting" the Player Character node and then dragging out the actor output and releasing in the graph and then searching for your Player Character's blueprint, for my example I would need a "Cast To FirstPersonCharacter" node and then from the Cast, drag out a node to the graph, release and type "Call Add Enemy Count" and your newly created function should pop up.
Keep in mind if you named your function something else, you'll need to "Call" whatever name you used for your function
answered Mar 14 '17 at 03:17 AM
Create a public integer variable to allocate the amount of AI deaths. For each dead AI, increment this variable by 1 in its own blueprint. In the third person map blueprint, make an event tick with a branch that checks if the variable is equal to 3. If it is, restart the level or load another one.
answered Mar 14 '17 at 02:54 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here