Dynamically loaded animation blueprints do not work within packaged product.
Download the pre-made project from here: [Link Removed]
1. Create a 3rd person c++ project
2. Modify the code like this: in ReproAnimBP.h, replace #include "EngineMinimal.h" by #include "Engine.h" (just so we can use GEngine to print some message on screen)
3. in ReproAnimBPCharacter.h, declare the following:
virtual void PostInitializeComponents() override;
4. In ReproAnimBPCharacter.cpp, add the following:
void AReproAnimBPCharacter::PostInitializeComponents() { Super::PostInitializeComponents(); FString AnimBPStringTest = "AnimBlueprint'/Game/ThirdPerson/Animations/ThirdPerson_AnimBP.ThirdPerson_AnimBP'"; //AnimationBP = Cast<UAnimBlueprint>(StaticLoadObject(UAnimBlueprint::StaticClass(), NULL, *AnimBPStringTest)); UAnimBlueprint* AnimationBP = LoadObject<UAnimBlueprint>(NULL, *AnimBPStringTest); if (!AnimationBP) return; GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Green, "anim BP OK"); }
5. Build the files
6. Create a blueprint referencing your newly created c++ actor
7. PIE (notice the print on the screen)
8. Package for Windows and review the log
Expected: The print should appear in both PIE and the packaged version of the game.
Result: The log doesn't show up in game when the game is packaged.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.8.2 |
Target Fix | 4.8.2 |
Created | Jul 27, 2015 |
---|---|
Resolved | Jul 28, 2015 |
Updated | Apr 27, 2018 |