Store a variable from an actor when destroyed

How can I store a variable when actor is destroyed without using game instance. Here is the basic function.


I duplicated this actor 10 times. When I overlap and integer actors becomes 5, it destroys but when I pass to second actor, integer value resets. I thought maybe if I use that actor as a child, maybe it can store parent variable values but no. I know how to use game instance and I did with game instance but I am not sure whether I have to use game instance to achieve this or not. I read other topics but everyone suggested different method to solve his problem rather than explain how to store a variable.

I created a new empty actor drag random point in scene so it will be created. Than I will create variables inside that actor and use those variables rather than my main actor so when my actor is destroyed, variables will not reset and registered in that actor so I can access whenever I want. Other than that any better idea to store a variable from destroyed actor.

The whole point of making a blueprint and then dropping instances in your level, is they are independent. You don’t want the second one to start knowing about what the first one was doing etc.

If you want to have an integer increment every time you destroy one of these actors, you either do it in the game instance, or a separate counter actor that you put in the level.

This is a totally standard way of working.

If you use a counter actor, it won’t work when you load a new map, because the counter gets destroyed too.

But, even if you start changing levels ( maps ), the game instance will know what your total was. That’s what it’s for.

If you want to be able to remember what the integer was between separate plays of the game, then you need to use a save game