BP loses its parent C++ class after re-opening the editor.

Hello, I’ve just started the UE5 course: Code a First-Person Adventure Game, in the first part, you make Game mode class and then create a BP from it. The issue I have is when you re-open the editor, the BP loses its parent class and the gamemode override (world setting) is set to none. Even in the “Project Settings” → “Maps & Modes” → “Default Gamemode” , it is set to none, you cannot find the BP in the list either, even when you first create it. Live coding is disabled and have tried closing the editor → building in VS and re-opening and refershing VS. Nothing I’ve tried seems to work.

Wondering if anyone else has encountered this problem? From my test, it seems to have come from the first-person template, since I made another project in third person, everything seems to be fine.

Close the Editor
Open your project folder and delete the following files and folders.

Re-Generate VS projectile files.

Open your project in VS by using the new .sln file.

Build Solution

Close Visual Studio and launch your project.

If prompted to rebuild modules, then do so.

Thanks for the reply, the above did not work. I deleted the project with the issue, but was able to recreate it again as I’ve done it a few times whilst trying to solve it myself.

I thought I give a more step by step of what I did to make it easier to replicate the issue.

  1. Made new project, First PersonBlueprintCreate

  2. Created a new game mode: ToolsNew C++ classGame Mode BaseCreate Class

  3. I get two pop ups, first one stating that the project includes sources and to close the editor and build from the IDE. The second one is the class has been made successfully but you need to recompile and asks if you want to edit the code now. I press yes, after couple of tests with no, this issue remains the same.

  4. I close the editor and build from the VS.

  5. Launch EditorC++ Classes(Project Name)Right click the game modeCreate blueprint class based on gamemodeRename BP_MyGameModeBaseselected destination to be in: First PersonBluePrintsCreate My Game Mode bas…

  6. Ctrl + Shift + S to save all

In the world settings, the BP will not appear in there, but you can drag or “Use Selected Asset from Content Browser” and the BP will be there.

NOTE: When trying to change the “GameMode Override” in the world setting, you will not find the BP in the list however you can drag the BP into it, but when you relaunch, I was presented with error messages:

CreateExport: Failed to load Outer for resource ‘DefaultSceneRoot_GEN_VARIABLE’: BlueprintGeneratedClass /Game/FirstPerson/Blueprints/BP_MyGameModeBasetest.BP_MyGameModeBasetest_C

CreateExport: Failed to load Outer for resource ‘SimpleConstructionScript_0’: BlueprintGeneratedClass /Game/FirstPerson/Blueprints/BP_MyGameModeBasetest.BP_MyGameModeBasetest_C

CreateExport: Failed to load Outer for resource ‘SCS_Node_0’: SimpleConstructionScript /Game/FirstPerson/Blueprints/BP_MyGameModeBasetest.BP_MyGameModeBasetest_C:SimpleConstructionScript_0


  1. Reopen the Editor and hover over the BP:

Note: I have also close the editor and built, the issue is still the same. Another thing to keep in mind, when re-launching the editor and hovering over the BP, you will see the parent class filled, after some time it will go or if you try to open it, you will get prompted this error message:

“Blueprint could not be loaded because it derives from an invalid class…”

  1. Close both VS and Editor and tried your steps.

TLDR:
Created a new gamemode on a fresh project (First Person), issue remains still.
I’m able to create a BP from the C++ class and add it to the gamemode override by dragging or using the arrow.
Upon relaunching editor, I’m presented with errors:

CreateExport: Failed to load Outer for resource ‘DefaultSceneRoot_GEN_VARIABLE’: BlueprintGeneratedClass /Game/FirstPerson/Blueprints/BP_MyGameModeBasetest.BP_MyGameModeBasetest_C

CreateExport: Failed to load Outer for resource ‘SimpleConstructionScript_0’: BlueprintGeneratedClass /Game/FirstPerson/Blueprints/BP_MyGameModeBasetest.BP_MyGameModeBasetest_C

CreateExport: Failed to load Outer for resource ‘SCS_Node_0’: SimpleConstructionScript /Game/FirstPerson/Blueprints/BP_MyGameModeBasetest.BP_MyGameModeBasetest_C:SimpleConstructionScript_0

and when opening the BP, I get this message:
Blueprint could not be loaded because it derives from an invalid class…

and the game mode override (world setting) is set to none.


This could be an issue with my machine and possibly need to reinstall both VS and UE5 just to be on the safe side, however, I’ve replicated these steps on third person, and it works perfectly fine.

I hope this explains my issue.

Thanks.

Note: I had multiple screenshots, but I can only put in one currently.

General process is:

  1. Tools → Create New C++ class.

  1. Live coding will boot and hot compile in the editor.

  1. VS will boot and generate the .h and .cpp AND typically prompts to Reload the project from disk.
    Press Reload All.

  1. Closed UE Editor, Then Build solution in VS.

The Output pane should note BUILD: n succeeded, 0 failed etc.

  1. Close VS.

  2. Open Project in UE Editor. Attempt to create a BP with your new class as parent.

Once you create the new BP, save the file, then close the project and restart it.

Verify the BP parent is valid.


IF your new class isn’t listed

Close UE editor
Delete the .VS, Binaries and Intermediate folders, then regenerate the VS project files.

Once generated, Launch the project in VS and Build solution again. Then, Jump to Step 5.

I launch from the .uproject file.

If you get prompted to rebuild modules, click Yes.

Your Class should now be available.

1 Like