Hi, I’ve got a project that’s been built in 5.3.2, and it’s been working just fine. Today I decided to try porting it forward to 5.4.2 to compare performance differences.
I was able to get the project up and running, and it works fine in the editor. However, when I make a packaged build for windows (which succeeds) attempting to run the game results in an instant crash with the following:
Assertion failed: false [File:D:\build\++UE5\Sync\Engine\Source\Runtime\UniversalObjectLocator\Private\UniversalObjectLocatorFragment.cpp] [Line: 569]
WARNING: POTENTIAL DATA LOSS! Universal Object Reference FragmentType Actor! This reference will be lost if re-saved.
Hi! Same problem here!
I investigated quite a lot and it looks like it comes from the Level Sequences in my project.
After investigation, I noticed that the crash is caused by the Fragment Types not being registered yet. However UObjects are loaded in the PreInit phase of Unreal just before the fragment types. So when loading the LevelSequences, fragment types are not registered yet. This seems to be the cause of the crash.
Even though I don’t have any idea for a fix. There is no commit fixing this on the main branch, no pull request related to that.
If anyone has a fix I’ll be glad.
And if I find one I’ll keep this thread updated!
In UniversalObjectLocatorFragment.cpp execute your delegate the first time the function bool FUniversalObjectLocatorFragment::Serialize(FArchive& Ar) is called. Personnally I have put a simple bool bHasRequestedFragmentTypesRegistering
It should look like
if (FragmentTypeID == NAME_None)
{
Reset();
}
else
{
// ==== CHANGE ====
if(!bHasRequestedFragmentTypesRegistering)
{
// Broadcast your delegate
bHasRequestedFragmentTypesRegistering = true;
}
// ==== END CHANGE ====
// Find the FragmentType
const FFragmentType* SerializedFragmentType = FRegistry::Get().FindFragmentType(FragmentTypeID);