Custom event that affect all the objects of a class, not just one


I need to have a way to keep track of which collectibles the player got for each level, like Banjo-Kazooie or Super Mario 64 : when the player collect a star/jiggy, it doesn’t reappear when you reload the level.

I have a collectible called Orb, when the player overlaps an orb, it calls a Dispatch Event with an Input containing its name (a self connected to a Display Name to have the string of it.)

In the level blueprint, it listens the Dispatch Event, puts the name of the orb in an array and I can press a button to print the array. It works, but the problem is that I can only do this for one of the orbs in the level. How can I make it so the event is working for all of the orbs, without doing it manually? Or is there another more intelligent way to do that?

Storing the variable in a “game instance” class (make a new blueprint) will make it so that when you go to the next level or reset your level, your variable count isn’t reset.

So maybe in that class, you can have a variable for the star count in every level, and it would just remember which orbs you’ve collected and which you havent?

Then transfer that to save / load feature so that the info will store forever on a save game - look up documentation for how to do that in blueprints there’s a lot of it and it’s pretty easy - and bam. Problem solved i think.

Hey, sorry for taking this long to answer!

So, I’m adding the orbs (actors) to an array inside the game instance, while it keeps the indexes in memory, the actor doesn’t appear when I print after changing levels (it prints a blank space.) Is there a way to keep the actors between levels, or is there another way to do it?