Component property inheritance sometimes does not behave as expected when opening a project with the -game command line argument. Attempting to load a child Blueprint through code may not correctly obtain the default values from the parent Blueprint if the parent Blueprint contains a reference to the child Blueprint. When running the project in PIE, the values are inherited correctly.
#include "Engine/StreamableManager.h" #include "Engine/AssetManager.h" #include "GameFramework/Character.h"
FStreamableManager& Streamable = UAssetManager::GetStreamableManager(); FSoftObjectPath AssetToLoad(TEXT("/Game/NewBlueprint_Child")); TSharedPtr<FStreamableHandle> NewHandle = Streamable.RequestAsyncLoad(AssetToLoad); NewHandle->WaitUntilComplete(); UBlueprint* FoundBlueprint = FindObject<UBlueprint>(ANY_PACKAGE, TEXT("/Game/NewBlueprint_Child.NewBlueprint_Child")); ensure(FoundBlueprint); UObject* DefaultObject = FoundBlueprint->GeneratedClass->GetDefaultObject(); ensure(DefaultObject); ACharacter* DefaultCharacter = Cast<ACharacter>(DefaultObject); ensure(DefaultCharacter); // These ensures fail when the project is opened with -game, but do not fail in PIE. ensure(DefaultCharacter->GetMesh()->SkeletalMesh); ensure(DefaultCharacter->GetMesh()->bDisableClothSimulation);
RESULT:
The last two ensures in the code above have failed and generated call stacks in the log.
EXPECTED:
None of the ensures have failed.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-54242 in the post.
4 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.18.3, 4.19, 4.20 |
Target Fix | 4.19 |
Created | Jan 19, 2018 |
---|---|
Resolved | Feb 14, 2018 |
Updated | Apr 27, 2018 |