How to find blueprint on loaded level?

Hi there,
You can add the execution code inside your target blueprint class that will repeat for all instances in the level, on its event “Begin Play”. So, every time a new level loads, that blueprint class, and all its instances, will load the save game, and search for value of Current Step Number. If that blueprint has an integer variable with that same number, it will execute the code automatically.

Or, in a much cleaner way, move your code to your game mode, because this class is loaded before any other actor in the level. So, on event begin play, load that information from the save game, getting the target blueprint. To do that, you want to use “get actor of class” for a unique blueprint class, or “get all actors of class with tag” + “get” array index 0, tag meaning “actor tag”, which is the value of Current Step Number, in case you have multiple instances of the same class (e.g. derived from the same “parent blueprint class”). That said, you don’t need that “Switch on Int”. You want to use Current Act Number as an “actor tag”.

The third option is moving the searching code to your game instance, which is “always loaded” regardless the level. This option is even better in case you have multiple game modes for different levels, so you don’t need to repeat this code for all of them.

I hope that makes sense.

1 Like