MothCocoon / FlowGraph

Design-agnostic node system for scripting game’s flow in Unreal Engine
https://discord.gg/Xmtr6GhbmW
MIT License
1.17k stars 228 forks source link

Change FlowEditor loading phase to "PreDefault" to fix corrupting FlowAssets when DefaultPawnClass for GameMode is set in C++ (as in Epic's templates) #221

Closed MaksymKapelianovych closed 4 weeks ago

MaksymKapelianovych commented 1 month ago

See detailed info for this bug here https://discord.com/channels/742802606874820619/1266207778398142464. In short, the problem is in this code:

AMyMode::AMyMode()
{
    // set default pawn class to our Blueprinted character
    static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/ThirdPerson/Blueprints/BP_ThirdPersonCharacter"));
    if (PlayerPawnBPClass.Class != NULL)
    {
        DefaultPawnClass = PlayerPawnBPClass.Class;
    }
}

If BP_ThirdPersonCharacter has Flow component and some FlowAsset as RootInstance, that asset will be corrupted (missing FlowGraph) after editor restart.

After changing LoadingPhase project was tested in DebugGame, Development and Shipping configurations - no issues was detected. But I am still not sure if I did not miss something.

MothDoctor commented 4 weeks ago

Accepted, thanks! :)