Hello,
I have the same problem here.
I’m trying to create an Actor in C++ with multiple components and would like to be able to edit/transform them in the Editor.
Adding multiple components by
UPROPERTY(EditAnywhere)
UStaticMeshComponent* SphereVisual1;
UPROPERTY(EditAnywhere)
UStaticMeshComponent* SphereVisual2;
SphereVisual1 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("FirstVisualRepresentation"));
SphereVisual1->SetupAttachment(RootComponent);
SphereVisual2 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SecondVisualRepresentation"));
SphereVisual2->SetupAttachment(RootComponent);
is no problem.
Adding multiple components with an dynamic array is not working
UPROPERTY(EditAnywhere)
TArray<UStaticMeshComponent*> mySphereComponents;
mySphereComponents.Add(CreateDefaultSubobject<UStaticMeshComponent>(TEXT("FirstVisualRepresentation")));
mySphereComponents.Add(CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SecondVisualRepresentation")));
mySphereComponents[0]->SetupAttachment(RootComponent);
mySphereComponents[1]->SetupAttachment(RootComponent);
I’m no longer able to edit/transform the components in the editor. It is only possible to set the transformations with numbers. See below.
Using a static array is not working either. I’m still not able to edit/transform the components in the editor.
Anyone able to help?
Thanks