I use SaveGameToSlot / LoadGameFromSlot and SaveGame blueprint.
After I load new level, I place player on saved location (it works) and then I want to find a blueprint from loaded level and execute it.
But it can’t find that blueprint - it search for it on that level, from which I load game, but not on new loaded level.
not clear from your code but if the above blueprint is called from the old level, so you are in a level start the execution of this blueprint in the old level, it doesn’t know about the new one. it will search in the level this blueprint knows about.
the blueprint lives in the old level which is still in memory somewhere and searches for stuff there.
it had open a new level but it doesn’t care about that one
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.