5.8 Gameplay Camera System Issue causing crashes

Have an odd issue. When we make changes in the level or in the code and save = no problem.

However when we play in editor and then try to save after, it crashes every single time.

Error Below:

Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 695] Illegal call to StaticFindAllObjectsFast() while serializing object data or garbage collecting! UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_BlueprintGraph UnrealEditor_BlueprintGraph UnrealEditor_GameplayCameras UnrealEditor_GameplayCameras UnrealEditor_GameplayCameras UnrealEditor_GameplayCameras UnrealEditor_GameplayCameras UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_Core UnrealEditor_Engine UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_MainFrame UnrealEditor_MainFrame UnrealEditor_Slate UnrealEditor_Slate UnrealEditor_Slate UnrealEditor_MainFrame UnrealEditor_MainFrame UnrealEditor_Slate UnrealEditor_Slate UnrealEditor_ApplicationCore UnrealEditor_ApplicationCore UnrealEditor_ApplicationCore UnrealEditor_ApplicationCore user32 user32

Hello there @mrtotoro94 !

That’s a quite bizarre scenario indeed, if saving works as intended before any live play, it should continue to work afterwards. Something is changing in UE after playing in editor.

Now, from that log extract, the main error is the following:

Illegal call to StaticFindAllObjectsFast() while serializing object data

Checking with my peers, that call refers to a thread-safety crash. In short, a process tries to search or access an object while the editor is in the middle of saving or garbage collecting, and that crashes the whole thing. Here’s what I would test for this case:

  • Make sure that any and all gameplay BPs are finished/closed before hitting save, specially anything related to Camera, as they may continue working in the background. Maybe even test by disabling the camera plugin altogether

  • Once you exit playing in editor, certain objects are marked for garbage collection, but are not immediately flushed. So, if the save happens too soon, the save process will trip with those pending deletions. So, either wait a few moments before hitting save, or force GC with cmdlet obj gc

Perfect, I will give that a try