Developer Notes

Suggested workflow is to create the component and then add it to an array rather than creating components as part of the array

Description

When an array is used to declare actor components, the component elements that make up the array cannot be edited inside blueprints.

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add code to project based on Actor (MyActor)
  3. In MyActor.h Add the following:
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
    		TArray<UBoxComponent*> Boxes;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
    		USceneComponent* MyScene;
    
  4. In MyActor.cpp add the following:
    	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);
    
  5. Compile
  6. Create blueprint based on MyActor (MyActorBP)
  7. Open MyActorBP to the viewport tab
  8. Select NewBox1 or NewBox2 in the component list

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.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

9
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.11
CreatedMar 8, 2016
ResolvedJul 15, 2016
UpdatedJul 14, 2021
View Jira Issue