Destroy 1 class actor when variable gets -1

Hi. I need to do a system so that when a variable gets -1 an actor would destroy itself. I basically have 1 actor for each variable on game. I made something but it just destroys all actors of the class on the level regardless if I get -1 or not, Please halp! :slight_smile:

Use a get from the array and destroy only the actor that you wish

Hi, thanks but I mean I need to destroy the whole 1 class on the level for each time Burg Amount integer variable get’s lower by 1. Can you please help to do this? My solutions destroys everything regardless of what’s happening, it just deletes everything

After the event tick you subtract 1 to the variable burg right? If is this, the event tick it’s every 0.0 frames by default.

I know, will try to explain it…

So I have a stock of burgers. Whenever player gives away 1 burger it must be destoyed on the level. He can give away 30 burgers at once and they all must be destoyed.
I have a variable for amount of burgers.

In my event tick I was trying to set a negative change in this variable by 1 (if/then) to be a trigger to destroy 1 food.

I see you are online please help

Without more context it’s really difficult to answer this. I’m guessing you have some kind of Burger class that represents the burger that the player is giving away. I also imagine there is some sort of player pawn that responds to input when the burger needs to be given away. I would then simply have the pawn call the “GiveAway” method on the Burger class and have it destroy itself after the “giving away” is done.