Hi!
Can’t an UObject contain sub components i.e. other UObject? When I try the following code the editor hangs before it starts up.
Decal1 = PCIP.CreateDefaultSubobject<UDecalComponent>(this, "Decal1");
Decal2 = PCIP.CreateDefaultSubobject<UDecalComponent>(this, "Decal2");
Declared as:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Decals)
TSubobjectPtr<UDecalComponent> Decal1;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Decals)
TSubobjectPtr<UDecalComponent> Decal2;
I get the following error messages:
D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.3\Engine\Source\Runtime\CoreUObject\Private\UObject\CoreNative.cpp(146): Assertion failed: SubobjectOuter
No corresponding destination object found for 'CustomDecalComponent /Script/RTSGame.Default__BaseStructure:Decal1' while attempting to instance component 'DecalComponent /Script/RTSGame.Default__BaseStructure:Decal1.Decal1'