Destroy one actor at a time from array

Hey Fryderider,

I will try to explain in words what you are doing:
The first time the GetWallBlock int variable is on 0, so you delete the 1st item in your array. Works fine, but you add 1 to your int, now GetWallBlock is on 1.
The second time you press space you will delete the 2nd item in your array, but you already deleted an item in your array, so you actually have 2 items in your array, so the second item is actually your third item in the array you started with. If that makes sense :stuck_out_tongue:

To fix it just delete the part where you add 1 to your GetWallBlock variable, this will always delete the next item.

Hope this helps :slight_smile:


I have three copies of the same blueprint actor in my level.

I want it so when I press spacebar, one actor get destroyed. When I press space again, another actor gets destroyed etc.

From the player blueprint I did this:

This doesn’t really work. When I press spacebar the first time the first actor gets destroyed. The second time the third actor gets destroyed which is kind of odd. The second actor remains and can’t be destroyed.

Oh man, it’s that easy!

Thank you! It’s working just as I want it to now :slight_smile: