# TArray elements editable in editor never gonna happen?

**URL:** <https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939>\
**Category:** C++\
**Tags:** editable, tarray, unreal-engine, editor, CPP, question\
**Created:** [March 8, 2016, 3:18pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939 "2016-03-08T15:18:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmicronNEGA](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OmicronNEGA](https://forums.unrealengine.com/u/OmicronNEGA)\
**Post date:** [March 8, 2016, 3:18pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/1 "2016-03-08T15:18:14Z")

</div>

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:

> **[TArray of UStruct of dynamic size as an editable UProperty](https://forums.unrealengine.com/questions/66481/tarray-of-ustruct-of-dynamic-size-as-an-editable-u.html)**
>
> I’d like to use a TArray of a UStruct as an editable UProperty in Blueprint. Like so. USTRUCT() struct FSomeStruct() { float thingToEdit; } UCLASS() class ASomeClass() { UPROPERTY(Editanywhere...etc) TArray Structs; } The current issue...

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

 ![81415-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/a/f1a440bb59168a4c0336c123d1cd73f0d32a85b5.png)

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/3/373189f2375bbd5b92c10f5f8c79064318dc9a32.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!!

---

<div class="post-metadata">

**Author:** ![rotwang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rotwang](https://forums.unrealengine.com/u/rotwang)\
**Post date:** [May 5, 2016, 3:24pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/2 "2016-05-05T15:24:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b5cfa23f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b5cfa23f](https://forums.unrealengine.com/u/anonymous_user_b5cfa23f)\
**Post date:** [May 6, 2016, 3:36pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/3 "2016-05-06T15:36:04Z")

</div>

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!

-

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc92d3c61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc92d3c61](https://forums.unrealengine.com/u/anonymous_user_fc92d3c61)\
**Post date:** [July 20, 2016, 11:33am UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/4 "2016-07-20T11:33:18Z")

</div>

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.

 ![99243-ok.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/1/651d49820b36f2f60dd62032aaa3bbc117ffecfb.jpeg)

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.

 ![99244-tarray_editor.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/4/4d461a63cccad0e70492d11a4400dc5e69a01e45.jpeg)

 ![99245-tarray.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/7/1077c6c34e227b24a9c5e61b513b8412573e5644.jpeg)

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc92d3c61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc92d3c61](https://forums.unrealengine.com/u/anonymous_user_fc92d3c61)\
**Post date:** [July 20, 2016, 11:34am UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/5 "2016-07-20T11:34:15Z")

</div>

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.

 ![99243-ok.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/1/651d49820b36f2f60dd62032aaa3bbc117ffecfb.jpeg)

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.

 ![99244-tarray_editor.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/4/4d461a63cccad0e70492d11a4400dc5e69a01e45.jpeg)

 ![99245-tarray.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/7/1077c6c34e227b24a9c5e61b513b8412573e5644.jpeg)

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

---

<div class="post-metadata">

**Author:** ![Rainbow.Warrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rainbow.Warrior](https://forums.unrealengine.com/u/Rainbow.Warrior)\
**Post date:** [June 22, 2017, 5:29am UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/6 "2017-06-22T05:29:31Z")

</div>

Same issueee, please send help.

---

<div class="post-metadata">

**Author:** ![Lord7even](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lord7even](https://forums.unrealengine.com/u/Lord7even)\
**Post date:** [December 25, 2017, 11:26pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/7 "2017-12-25T23:26:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![FeyDreamers](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FeyDreamers](https://forums.unrealengine.com/u/FeyDreamers)\
**Post date:** [February 17, 2018, 12:51am UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/8 "2018-02-17T00:51:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Une\_Spatule](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Une\_Spatule](https://forums.unrealengine.com/u/Une_Spatule)\
**Post date:** [November 20, 2024, 4:16pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939/9 "2024-11-20T16:16:01Z")

</div>

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

```cpp

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;

```
