Suggested workflow is to create the component and then add it to an array rather than creating components as part of the array
When an array is used to declare actor components, the component elements that make up the array cannot be edited inside blueprints.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) TArray<UBoxComponent*> Boxes; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) USceneComponent* MyScene;
MyScene = CreateDefaultSubobject<USceneComponent>(TEXT("MyScene")); RootComponent = MyScene; Boxes.SetNum(2); Boxes[0] = CreateDefaultSubobject<UBoxComponent>(TEXT("NewBox1")); Boxes[0]->AttachTo(RootComponent); Boxes[1] = CreateDefaultSubobject<UBoxComponent>(TEXT("NewBox2")); Boxes[1]->AttachTo(RootComponent);
Result:
Transform widget is missing and Details panel is blank so the component cannot be edited through the blueprint
Expected:
BP components that are created as part of an array can be edited through blueprints.
Head over to the existing Questions & Answers thread and let us know what's up.
9 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.11 |
Created | Mar 8, 2016 |
---|---|
Resolved | Jul 15, 2016 |
Updated | Jul 14, 2021 |