I have the same problem 4.22 after add a var in struc from my parent class and a other var changed.
My solution is to change the var in parent class and changed back and save parent class. All child class would be saved and my child class data is not lost.
This bug still alive, in UE 5.1 from source compile ue5- branch
My child blueprints of a common parent, have all their inherited static mesh reseted to parent setted mesh.
I try set the mesh at it, save it works in editor, but as soon i restart editor or reload the blueprint asset its gone!
It started happen suddenly, and only affects this specific blueprint hierarchy.
If i create a new hierarchy from actor base, it works normal.
So i believe this blueprint asset become somehow corrupt and always get it value reseted at the 3rd level hierarchy and above
So for who has similar issues unreal engine runs into lots of corruption issues with migrating projects new version, change control and when the engine crashes.
Most cases I think what happens is that it attempts to cache and keeps multiple save states during those things and it can’t reconcile which is the correct state leaving your project with broken child’s or incorrect BPs.
Solution that I have found worked consistently which people have mentioned earlier is cleaning up all temp/cached files. That includes if you use change control the diff folder and the intermediate folder if all else fails. I don’t believe it doesn’t happen to epics in house team and I can imagine they prob routinely cleanup those files since a number of things can easily throw your project out of wack.
I think rule of thumb if unexplained issues happening with your project wipe those files out. Can be annoying to recompile things but will save yourself a lot of cells later. Do like a monthly cleanup overnight or something.
if the root of your parent is the original default scene root, it seems to always want to go back to movable, causing problem in its children relative to mobility.
This problem still exist in UE 5.1 and its very very frustrating. My child blueprint actors keep reseting continusly everytime I close Unreal Engine. I couldnt find any solution, I delete every cache folder and problem still continues.
Not sure if this is the same issue for but I noticed an issue which is 100% reproducible and as far as I can tell it means you should avoid setting values in the constructor.
Steps to reproduce
declare a C++ class type with, for instance, a pointer as a member (any member type will do)
assign that member a value in the C++ constructor
use this C++ type as a base class for any blue-print class.
When the C++ class is constructed the constructor for your class is invoked and you assign your value, so far so good.
Unreal allocates your object from using an FObjectInitializer on the stack:
Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp
UObject* StaticConstructObject_Internal(const FStaticConstructObjectParameters& Params)
//... for brevity
if (!bRecycledSubobject)
{
STAT(FScopeCycleCounterUObject ConstructorScope(InClass->GetFName().IsNone() ? nullptr : InClass, GET_STATID(STAT_ConstructObject)));
(*InClass->ClassConstructor)(FObjectInitializer(Result, Params)); // < this version of FObjectInitializer() sets FObjectInitializer::bShouldInitializePropsFromArchetype to true, and there's no way for the application to tell it not to do this as far as I can tell
}
When the above FObjectInitializer goes out of scope it invokes it’s destructor which has the following code that is about to overwrite your value:
if (bShouldInitializePropsFromArchetype) // recall this value was set to true in the constructor used by StaticConstructObject_Internal
{
UClass* BaseClass = (bIsCDO && !GIsDuplicatingClassForReinstancing) ? SuperClass : Class;
if (BaseClass == NULL)
{
check(Class==UObject::StaticClass());
BaseClass = Class;
}
UObject* Defaults = ObjectArchetype ? ObjectArchetype : BaseClass->GetDefaultObject(false);
InitProperties(Obj, BaseClass, Defaults, bCopyTransientsFromClassDefaults); // <- will overwrite any fields you set in your constructor with what it considers the defaults from the CDO
}
Yes and BeginPlay() as well. It’s worth nothing that I believe the issues I was seeing is specific to things like pointers. The CDO runs the constructor so any non pointer types should be set in the CDO properly.
This bug is still there in UE5.1, any child character BP always gets its components and values reset to parent defaults. This occurred when using constructors, the values and even the mesh components were reset.
Edit: Solved when ticked “Force Update” for the node “Set Leader Pose Component” in the Construction Script of the parent character BP, there’s no such bug to use inheriting with construction script in UE5.1.
I know this is an old thread but I see this is a popular topic and I recently encountered it so I’m leaving a comment in case it helps anyone else.
At least in my case it was because of circular dependencies in blueprints. I put a breakpoint in Visual Studio in the constructor of the first ancestor of my blueprint that’s in C++. I then stepped through the code watching for the problematic blueprint class to appear (something like “Default__BP_Hero_Character”), then went down the callstack looking for circular dependencies. After finding one, I’d open the editor and fixed that circular dependency and repeated the process. When I was done, the problem had gone away.
Unreal should throw warnings when compiling blueprints when users create circular dependencies. Not a fix, but at least people would know where to look for issues.
For anyone running into these issues: I recently wrote a tutorial that may help by giving a high level view of bp loading engine code and how it should work and then some tips on how to find where things go wrong. One of the first things to check being circular dependencies like rantrod mentions.
Don’t expect to solve all issues with it but it should help with understanding the engine code and narrowing down what happens in a project. If you have a repeatable problem (a working asset and repro steps to break it) that’s also incredibly useful, so please consider sending it with a bug report. Seeing the asset break or knowing exactly which class and subobject hierarchy is causing problems helps us eliminate more and more causes of this issue.
I’m not sure if this is related but I had a child actor that was not retaining an array of static meshes (where the parent had zero by default), I fixed the issue by setting the array to be “Blueprint Read Only” (not sure if this was needed) and “SaveGame” to serialize the array variable via the Details panel, the child actor then spawned the meshes.
Joining the club of people who encountered that issue.
In my case issue was with a second child of a Blueprint class.
My class structure is the following:
Empty C++ class (no default scene root in C++, just empty class)
This issue just happened to me yesterday for the first time and now it never goes away. Every time I open my project file it removes information from my child blueprints which are all in a structure in the parent. Tried many things and so far no permanent fix.
In my case, I have a child actor component, and in the components of the child actor I am setting some values.
The values stay for a BP base class, but for its child class the component values keep reverting to the defaults for the child actor class, rather than inheriting the values from its parent.
I am getting around it for now by making a child class of the class used in the child actor and setting the desired values there, but it is definitely not an ideal setup.
Also confirmed that it’s not just for components of children spawned by child actor components. I tried working around by putting the properties in the Actor that contained the component I wanted to set up and the variables still wouldn’t save for the actor.
It also only appears to occur for properties originate from C++. Properties that I create on the BP that is being spawned via the Child Actor component apply properly in the child BP class.