Packaging fail due to missing file

Hi,

So I have been trying to package a game which works in the editor perfectly for the last 3 days and have been failing repeatedly. The packaging log says that it can’t find a file, and I am not sure why, so upon exploring I am not sure why this is happening as I will show here:

So in the main character class, ATMOCharacter, there is a UAnimBlueprint pointer

From the ATMOCharacter header file

/** Pointer to Animation Blueprint corresponding to the Standard Character*/
UPROPERTY(EditAnywhere, Category = AnimationBlueprints)
UAnimBlueprint* StandardCharAnim;

Then, the blueprint class BP_ThirdPersonCharacter extends the ATMOCharacter class and fills in a definition of this variable

218276-editor.jpg

Then in the ATMOCharacter.cpp class, this variable is used, as shown in the BeginPlay function snippet shown here

	if (GetMesh())
	{
		UE_LOG(CustomGameModeLog, Warning, TEXT("ATMOCharacter: BeginPlay: GetMesh valid"))
	}
	else {
		UE_LOG(CustomGameModeLog, Warning, TEXT("ATMOCharacter: BeginPlay: GetMesh invalid"))
	}

	if (StandardCharAnim)
	{
		UE_LOG(CustomGameModeLog, Warning, TEXT("ATMOCharacter: BeginPlay: StandardCharAnim valid"))
	}
	else {
		UE_LOG(CustomGameModeLog, Warning, TEXT("ATMOCharacter: BeginPlay: StandardCharAnim invalid"))
	}

	GetMesh()->SetAnimInstanceClass(StandardCharAnim->GetAnimBlueprintGeneratedClass());

Now, when I play this in the editor, it claims the StandardCharAnim pointer is valid, whereas the packaged version claims it is not valid.

The BP_ThirdPersonCharacter class has been set as the Default Pawn, within the blueprinted gamemode class which has been set as the default gamemode from within the project settings.

The log file for the packaged game
[log file][2]

The log file for the editor which performed the packaging operation
[packaginglog][3]

Any suggestions would be greatly appreciated,

Thanks

This is just a guess, but it is possible that in packaged version the engine first trying to create a default object BP_ThirdPersonCharacter without any settings. But you do have a problem in your code:

GetMesh()->SetAnimInstanceClass(StandardCharAnim->GetAnimBlueprintGeneratedClass());

GetMesh() can return NULL and ** StandardCharAnim** can be NULL

what you need is like this:

if(GetMesh() && StandardCharAnim)
    GetMesh()->SetAnimInstanceClass(StandardCharAnim->GetAnimBlueprintGeneratedClass());

run it again without the game crash first and see if it helped.

Thanks, yeah it seems checking for both causes the game not to crash immediately, and the character appeared in the world, however it seems the StandardCharAnim is still invalid even after the game has loaded, so the character walks around without any animations.

Edit: On further tests, it seems that meshes I added in the character blueprints have been correctly loaded, but upon adding another animation blueprint it seems neither are loading in correctly. So it is just the animation blueprints I add in the character blueprint that aren’t loading