TArray elements editable in editor never gonna happen?

Firstly, this is not a duplicated question.
I have a class member

TArray<USceneComponent*> ActorsOnEachNote;

I created some USceneComponent instances and added to this array.
Then I want to edit these instance in editor, so I did some google and found this:

This is “kinda” working, because I want to set these instances’ position, but the solution above is like:

To set positions, I have to first select root component, then find element and set positoin.
Obviously, it is impossible to set positions with only numbers.I want to set positions directly in editor,
like a normal class member with UPROPERTY declared correctly.
But this is what I get:(Root is the component I created using Rama’s USTRUCT method. )

81416-1.png

native components are editable when declared as a property in c++.
Again, it is impossible to set positions with only numbers.
So am i running out of options?
And of course, I do have workaround, just use a static array with MAX_NUMBER defined.
But I really want to use dynamic arrays.
Please help me here, thanks!!

I have the same problem. My actor has a TArray with a dynamic count of components.
When I select one of those components, I expected to be able to edit its parameters.
Instead, I get the “Native components…” message.
Has someone a better idea than workaround with a static array?

Hi OmicronNEGA,

I’d love to help, but I’m not quite clear on what you’re looking to do yet or how that is different from what you have.

It sounds like you want to have a TArray of dynamically created components that is visible in the editor and allows you to edit the properties (e.g. transforms) of the elements. Is this right? Further, it sounds like you want these components (which will be added to the component hierarchy) to be editable directly from the hierarchy view. Is this correct too?

Judging from your screenshots, it looks like the properties of the array elements are editable but the components are not editable from the hierarchy view. If I’m understanding this correctly, the second part is the problem. Is this right?

If my understanding is correct, can you show me the code you’re using for the TArray and for setting up the components? If I’ve misunderstood something, can you help me understand it better?

Thanks!

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

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

Same issueee, please send help.

I have the same problem. Is there any news on that front?

It’s exactly as you described. So… do you know the solution?

If you cannot make the components array editable in the detail panel, consider changing the CreationMethod of your components. Here’s an example:


MyComponentArray.SetNum(2);

MyComponentArray[0] = CreateDefaultSubobject<UMyComponent>(TEXT("Component1"));
MyComponentArray[0]->CreationMethod = EComponentCreationMethod::Instance;

MyComponentArray[1] = CreateDefaultSubobject<UMyComponent>(TEXT("Component2"));
MyComponentArray[1] ->CreationMethod = EComponentCreationMethod::Instance;