Crash in UniversalObjectLocatorFragment in 5.4.2, only in windows build

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.

Any suggestions?

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!

Thanks,
Adrien

I’ve got a fix, but it’s ugly and needs a source build of Unreal and some C++ skills.

If you are as desperate as I was here are the steps to follow.

  1. Create a custom delegate, do it the way you prefer
  2. Change these bindings to be bound to your delegate (only if not with editor)
Engine\Source\Runtime\UniversalObjectLocator\Private\UniversalObjectLocatorModule.cpp [27]
#if WITH_EDITOR
FDelayedAutoRegisterHelper(EDelayedRegisterRunPhase::ObjectSystemReady
#else
//Your delegate
#endif
Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp [321]
#if WITH_EDITOR
FDelayedAutoRegisterHelper(EDelayedRegisterRunPhase::RequestFragmentTypes,
#else
//Your delegate
#endif
  1. 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);

Compile, run and enjoy!

I hope Unreal comes with a better fix.