Victory after the destruction of blocks

Hi!
I need to finish the level by destroying all the blocks. How do I do this? I used to make blocks spawn, but now I put them myself.

I tried to make it so that when destroying one block, I have a counter variable that will be subtracted by one when destroying it (I did this in block bluprint). But the problem is that each block does this operation for itself, and in the end all blocks have their own variable that is subtracted once. But I need that for each destroyed block, the variable takes away not 1, but 2, 3, and so on.

Or it is can do it another way, but how?

You can do it like this:

You can do it in any blueprint outside of the block you’re destroying. Use ++ or --, whichever you find more logical. The red event node will be called every time an actor receives a *Destroy *call. There’s no need to count anything inside the actor being destroyed; that’s unless it must know it for some reason, which is unlikely - it’s getting destroyed anyway… :smiley:

note1: you do not need to *SET *a variable after ++/–, those nodes set values by reference already.
note2: in your example, if you call *Destroy *and then try to do another thing after, it will not work - the object is being destroyed

When should the blocks be removed? What must happen for the block to be removed. The character touches the block and is it removed?
There are many solutions.
Or did you just finish the level and you want to remove all blocks from it?

A block can be called by a character or other element and then you destroy it. Collision.

I am very grateful to you! I asked this question many times but could not implement the tips!
You will not believe it, but with this easy problem I suffered for a week, but now I can go further :eek:​​​​​​​