Array in Blueprint Class gets reset

Hi. I’m working on a project where I have a blueprint with an array of actors. The actors in the array are just other “usable actor” objects I’ve placed in the world and added into the array manually, which is used for puzzles and other things… but however when I sometimes make an edit to this class that has the array, the array will get reset, along with other variables. It’s really incredibly annoying, as its hard to make any progress in level design when they keep getting reset if I need to make a small tweak or something else to that class, which is used quite a lot. I’ve also noticed sometimes it will get reset after reloading the editor too, but this feels like it would be related to the problem of variables getting reset after recompiling.

Any help on this would be great. Feels like a bug. Note: the project started in 4.10 and has been following me for a while. Was hoping engine upgrades would fix it, but I guess not.

Can you show us some code or blueprints please?

Hi, I’d be happy to show some blueprints, but I’ll be honest - its a lot of code. It also has a parent class I should mention (but nothing that would delete things from the array, same with base class). I’m also finding that it might not be on recompiling, but maybe something with the project closing and reloading as that’s the only times it really seems to occur.

I remember hearing about an issue sort of similar all the way back to 4.10 that did something like this to child blueprint classes, but I might be wrong. I’m not sure if it was fixed, and even if it was, would have the possibility of following me to this version of the editor.

Hello, Higuy8000,

Might be a horrible workaround and not a fix to the original problem at all, but for functionality sake and ease of progress, have you tried to make your array inside a struct that gets called by your blueprint? And making a variable with your struct as datatype inside your class? This way the contents of your array would be independent of your class blueprint, if that is where the problem lies. Depending on your implementation it might help alleviate the problem.

Hey - haven’t tried this yet. It is indeed a horrible solution, its unacceptable that an issue like this even exists and would need a workaround… (I was even finding out a lot of others seem to have a similar issue on slack last night).

I’m seeing more and more info though, and seems like the issue lies with the actual levels themselves. I had two levels that are nearly identical - one I had been working in and the other was just a copy. They both had the same actors with the arrays and only 1 - the one I was editing - got reset.

I’m wondering at this point if its simply a blueprint only issue, and if I should go ahead and just remake all the classes in C++ (last resort though, its a ton of code).

I should comment, too, that I have other actors that have similar setups and have not had any issues what so ever, even when these actors get reset.

Update: looks like its this issue: https://answers.unrealengine.com/questions/246046/certain-bp-class-properties-keep-losing-value.html // Unreal Engine Issues and Bug Tracker (UE-22557)

This was reported almost a year ago, people are still complaining about it and hasn’t been fixed. It’s marked as CNR in the system (although, the bug does not seem entirely accurate), but people in that same thread are still complaining about it not working (and its not working here, either). I went ahead and commented in that old thread, but if some Epic dev see’s this here: I’d be more than happy to upload my entire project so this can get fixed and I can specify exact examples of where the issues are occurring. I don’t know exact repro steps yet.