Why are my blueprint values resetting when unreal closes?

I made a blutility function that preconfigures a bunch of my blueprint’s variables while still in the editor, and verified that it works and correctly sets everything up. However, every time I change levels or close and re-open unreal, all of my variables have been reset to zero. Is there something obvious that would cause this?

Can you share more details, like screenshot of those blueprints and what you mean by preconfigure?

Sure! I use the same logic in multiple places with a fairly wide variety of variable types, and all of them show the same behavior of resetting, but the following is a pretty typical example of what I’m using it for: in order to simulate NPC behavior in areas that aren’t streamed in, I harvest a small amount of data about each streaming level (encapsulated in the AZone class), and keep it in a database in the persistent level. Since the only time that every single level is simultaneously loaded is during editing, I actually secure the data in the editor, by running the following function to find every streamed zone and copy whatever data I want. When I run this in the editor it correctly adds the requested structs, and I can visually examine their values and confirm everything is correct, but closing and re-opening the editor (or changing levels) results in the list I’m adding structs to emptying itself. The same behavior persists for ints, strings, and any other value I try to track persistently:

Do you means contents of arrays get reset when you load a new map?

That’s correct- the arrays fill correctly when I run the above function, but loading a different level, then returning to this one empties the arrays, as does closing and re-opening unreal. My first thought was that the constructor might be emptying them, but I explicitly checked and there shouldn’t be anything touching the contents other than the above function.

…so I feel dumb, I think it was a hot reload issue- deleting everything in the level that uses this logic, then re-adding the same exact blueprint, fixed the issue :slight_smile: