Uproject launch fails to find custom game instance and animinstance

I’ve created a custom game instance and animinstance through c++, when creating a packaged build everything works, when running in editor everything works, however right clicking the uproject file and selecting launch i get these errors

CreateExport: Failed to load Parent for BlueprintGeneratedClass
[2021.04.14-16.28.49:976][ 0]LogLinker: Warning: CreateExport: Failed to load Parent for B/Game/BlueprintGeneratedClass
[2021.04.14-16.28.49:976][ 0]LogLinker: Warning: Unable to load Default__BP_ with outer Package because its class does not exist
[2021.04.14-16.28.49:977][ 0]LogLinker: Warning: CreateExport: Failed to load Parent for BlueprintGeneratedClass
[2021.04.14-16.28.49:978][ 0]LogEngine: Error: Unable to load GameInstance Class

any help would be appreciated, thanks

1 Like

I had this same problem in UE 4.27 after creating a C++ class that derives from UGameInstance and configuring it to be part of a plugin.

After that, using the class name as the “Game Instance Class” in Project Settings under “Maps & Modes” caused the issue described by @fhosn

The solution was to edit the .Build.cs file of the project and add the plugin name as part of the PrivateDependencyModuleNames list.

  1. Check that your custom game instance and animation instance classes are correctly included in your project’s build settings. To do this, go to your project’s “Project Settings” > “Packaging” > “List of Maps to Include in a Packaged Build” and make sure that all relevant maps and assets are included in the build.

  2. Verify that your custom game instance and animation instance classes are correctly set up. Make sure that they are correctly extending the necessary engine classes and are using the correct include statements in your source code.

  3. If your custom classes are blueprint-derived, try recompiling them in the editor and saving the changes before launching the game again.

  4. Check that your custom classes are not being optimized out of the build by the linker. This can happen if the linker thinks that your classes are not being used in the code. To fix this, try adding a dummy reference to your custom classes in your code, such as by creating an instance of the class.

If none of these work, try checking the logs for any more detailed error messages.

You can also try launching the game in debug mode to get more information about what is happening during the launch process :eyes: