How to end game when all enemies are destroyed?

Currently I’m trying to end the level once all enemies are destroyed “Cube enemy” and currently the system I have in place is on a Game Mode Blueprint, and I think my largest issue is not knowing how to make this blueprint register a destroyed enemy. Any ideas/help?

This is how i did it:

Tell me if something is not clear and i will explain you. I reproduced your idea, so i putted the control of the there is at least 1 enemy on the map in the “Gamemode” blueprint. Where i control if “Lenght>1” is not a error, if you insert “Lenght>0” it will never fires.

Ah, i forgot. The “Damaged” event fires everytimes i click on a cube.

Click the vote button and accept this as answer if is what you was looking for, thank you

Could you tell me what doesn’t work of your script?

The “destroyed” event?

If you put some “print” node we can see where the script stops and then fix it

Ps: could you show me where you call the “apply damage” node?

Thank you so much for your straight forward answer it’s awesome :smiley: currently I have tried to copy this system but part wont fit inside my “Basic Enemy” AKA Cube Enemy Blueprint. Again thx for the help!

Down below is what my blueprint used to be; this system did work - taking 1 point each time the enemy dies, but the only problem is that the blueprint would be destroyed with the enemy so it could never count down past 1. I was told to transfer the system to a Game Mode Blueprint so it counts every time a enemy dies without being destroyed with it. Largest problem is it does not register when the enemy dies. I relies you have supplied me with that knowledge and I thank you. But it does currently conflict with my damage system so if there is any way to fix this issue you would be a hero.

Could I ask you to upload your project and send me a link for download it? (via Google drive, If you can), so I can take a deeper look

PS: add me on skype so we can talk more freely
ID: X-BiGBoSs-

I have changed my skype id: davide.fanto

Sorry about that

No one found under the name “X-BiGBoSs-”. Also thanks again for the help, i’ll make sure to add you as soon as possible and send you the project! Skype name “Santeon” - Picture is a red, white and black mask

It’s really simple, make a variable called EnemyAmount.

Whatever the game type you have, just go

Whenever an enemy is spawned → EnemyAmount == EnemyAmount + 1

Whenever an enemy is killed/defeated/whatever → EnemyAmount == EnemyAmount - 1

Then, at the end of some loop you may have or wherever logical place it makes sense to put it, have:

If EnemyAmount == 0 → CombatEnds (this can be a custom event or a function)

If you don’t know where to put that ^

You can put it in an Event Tick, though Event Ticks take more ressource than finding a good place to place that If.

ps. "If"s are called “Branch” in Unreal.

sent the invite