Don’t ever do this:
or this:
You don’t need to use tick at all for something that can be purley event driven.
Here is a suggestion on how you could achieve this:
- Using two actors, one is the baloon and the other the door:
-
The first will be the ‘baloon’:
It only has to destroy itself when overlapped by the player. -
For the door first create a variable of type actor and set it as an array. Make it instance editable so that we can pick the balloons we want to be destroyed before opening the door:
-
Next we make sure our array is safe to work with then we bind OnDestroyed event to know when a balloon has been poped:
-
Finally our logic to know when all have been destroyed:
Result:
Here are some links about direct BP communication and binding:
- Direct Blueprint Communications | Unreal Engine Documentation
- Binding and Unbinding Events | Unreal Engine 4.27 Documentation
Hope it helps