Basic c++ pawn w/ associated blueprint link failure during packaging but works in editor

Anyone have issues with a blueprint inheriting from a c++ class fail to link during packaging causing the playable pawn to be unusable when running the packaged exe?

LogPlayLevel: Warning: LogLinker: Warning: CreateExport: Failed to load Parent for BlueprintGeneratedClass /Game/Blueprints/MyPawnBP.MyPawnBP_C
LogPlayLevel: Warning: LogLinker: Warning: Unable to load Default__MyPawnBP_C with outer Package /Game/Blueprints/MyPawnBP because its class (MyPawnBP_C) does not exist

I;

  • created a c++ pawn with some custom movement/looking code
  • created a blueprint that inherits from this class
  • created my own gamemode blueprint and set the default pawn to my new pawnbp
  • play in editor works as expected
  • package, warnings appear, unable to move or do anything in the game and believe the warnings are pointing to the cause

Any ideas? I can provide more details as needed…

This is a known issue albeit you’d hope for a little better clarity or warning from the engine.

GEngine not initialized! Problem - Unreal Engine / Programming & Scripting - Unreal Engine Forums

The following code change resolved my issue from the offending class constructor.

SphereComponent->SetMassOverrideInKg(NAME_None, MassInKG);

to

SphereComponent->BodyInstance.MassScale = MassInKG;