# How to sort scene components alphabetically or at least reorder them?

**URL:** <https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, CPP, Blueprint, UE4-27, question\
**Created:** [June 7, 2022, 8:58pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499 "2022-06-07T20:58:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [June 7, 2022, 8:58pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/1 "2022-06-07T20:58:28Z")

</div>

I’m getting really frustrated by this thing and I can’t seem to find a solution:

Scene components are randomly placed in the actor hierarchy, they don’t seem to follow any rule…

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/2/2921aa1914f347c369974460ba5aaf3ab830153c.png)

If I duplicate one of these, the new ones are added in the middle or in some random position:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/5/8d52272ad7bdb425669b316ffe9ca3d173a9dc30.png)

They are declared and attached in the desired order, I also tried to add the metatags “DisplayPriority” and “DisplayAfter” but nothing changes

> **.h File**
>
> ```auto
> AAntheaCharacter_Arkan_M();
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> class USkeletalMeshComponent *AntennaeComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *BladeComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *ChestAdditionComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *ChestComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *GauntletComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *GemComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *GloveComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *HornComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *KabutoComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *NeckComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *NecklaceComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *ShoulderAdditionComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *ShoulderComponent;
> 
> UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *TrouserComponent;
> 
> ```

> **.cpp File**
>
> ```auto
> AAntheaCharacter_Arkan_M::AAntheaCharacter_Arkan_M()                                                                                        
> {                                                                                                                                           
> auto BodyMesh = ACharacter::GetMesh();                                                                                                  
>                                                                                                                                             
> AntennaeComponent = CreateDefaultSubobject<USkeletalMeshComponent>("AntennaeComponent");                                                
> AntennaeComponent->SetupAttachment(BodyMesh);                                                                                           
>                                                                                                                                             
> BladeComponent = CreateDefaultSubobject<USkeletalMeshComponent>("BladeComponent");                                                      
> BladeComponent->SetupAttachment(BodyMesh);                                                                                              
>                                                                                                                                             
> ChestAdditionComponent = CreateDefaultSubobject<USkeletalMeshComponent>("ChestAdditionComponent");                                      
> ChestAdditionComponent->SetupAttachment(BodyMesh);                                                                                      
>                                                                                                                                             
> ChestComponent = CreateDefaultSubobject<USkeletalMeshComponent>("ChestComponent");                                                      
> ChestComponent->SetupAttachment(BodyMesh);                                                                                              
>                                                                                                                                             
> GauntletComponent = CreateDefaultSubobject<USkeletalMeshComponent>("GauntletComponent");                                                
> GauntletComponent->SetupAttachment(BodyMesh);                                                                                           
>                                                                                                                                             
> GemComponent = CreateDefaultSubobject<USkeletalMeshComponent>("GemComponent");                                                          
> GemComponent->SetupAttachment(BodyMesh);                                                                                                
>                                                                                                                                             
> GloveComponent = CreateDefaultSubobject<USkeletalMeshComponent>("GloveComponent");                                                      
> GloveComponent->SetupAttachment(BodyMesh);                                                                                              
>                                                                                                                                             
> HornComponent = CreateDefaultSubobject<USkeletalMeshComponent>("HornComponent");                                                        
> HornComponent->SetupAttachment(BodyMesh);                                                                                               
>                                                                                                                                             
> KabutoComponent = CreateDefaultSubobject<USkeletalMeshComponent>("KabutoComponent");                                                    
> KabutoComponent->SetupAttachment(BodyMesh);                                                                                             
>                                                                                                                                             
> NeckComponent = CreateDefaultSubobject<USkeletalMeshComponent>("NeckComponent");                                                        
> NeckComponent->SetupAttachment(BodyMesh);                                                                                               
>                                                                                                                                             
> NecklaceComponent = CreateDefaultSubobject<USkeletalMeshComponent>("NecklaceComponent");                                                
> NecklaceComponent->SetupAttachment(BodyMesh);                                                                                           
>                                                                                                                                             
> ShoulderAdditionComponent = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderAdditionComponent");                                
> ShoulderAdditionComponent->SetupAttachment(BodyMesh);                                                                                   
>                                                                                                                                             
> ShoulderComponent = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderComponent");                                                
> ShoulderComponent->SetupAttachment(BodyMesh);                                                                                           
>                                                                                                                                             
> TrouserComponent = CreateDefaultSubobject<USkeletalMeshComponent>("TrouserComponent");                                                  
> TrouserComponent->SetupAttachment(BodyMesh);                                                                                            
>                                                                                                                                             
> }                                                                                                                                           
>                                                                                                                                             
> 
> ```

Do you know if there’s a way to give them a custom order?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [January 11, 2023, 12:59am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/2 "2023-01-11T00:59:40Z")

</div>

It is painfully annoying when I have many components, do u have a good solution or workaround?

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [January 11, 2023, 7:38am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/3 "2023-01-11T07:38:51Z")

</div>

Hi, I tried giving using the same name for components having different numbers, but it didn’t work, sometimes values are swapped (In an apparently random way, another user told me it could be caused by multithreading when creating the CDOs)

> **.h file**
>
> ```auto
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component1;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component2;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component3;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component4;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component5;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component6;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component7;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component8;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component9;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component10;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component11;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component12;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component13;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USkeletalMeshComponent *Component14;
> 
> ```

> **.cpp file**
>
> ```auto
> Component1 = CreateDefaultSubobject<USkeletalMeshComponent>("AntennaeComponent");
> Component1->SetupAttachment(RootComponent);
> 
> Component2 = CreateDefaultSubobject<USkeletalMeshComponent>("BladeComponent");
> Component2->SetupAttachment(RootComponent);
> 
> Component3 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestAdditionComponent");
> Component3->SetupAttachment(RootComponent);
> 
> Component4 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestComponent");
> Component4->SetupAttachment(RootComponent);
> 
> Component5 = CreateDefaultSubobject<USkeletalMeshComponent>("GauntletComponent");
> Component5->SetupAttachment(RootComponent);
> 
> Component6 = CreateDefaultSubobject<USkeletalMeshComponent>("GemComponent");
> Component6->SetupAttachment(RootComponent);
> 
> Component7 = CreateDefaultSubobject<USkeletalMeshComponent>("GloveComponent");
> Component7->SetupAttachment(RootComponent);
> 
> Component8 = CreateDefaultSubobject<USkeletalMeshComponent>("HornComponent");
> Component8->SetupAttachment(RootComponent);
> 
> Component9 = CreateDefaultSubobject<USkeletalMeshComponent>("KabutoComponent");
> Component9->SetupAttachment(RootComponent);
> 
> Component10 = CreateDefaultSubobject<USkeletalMeshComponent>("NeckComponent");
> Component10->SetupAttachment(RootComponent);
> 
> Component11 = CreateDefaultSubobject<USkeletalMeshComponent>("NecklaceComponent");
> Component11->SetupAttachment(RootComponent);
> 
> Component12 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderAdditionComponent");
> Component12->SetupAttachment(RootComponent);
> 
> Component13 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderComponent");
> Component13->SetupAttachment(RootComponent);
> 
> Component14 = CreateDefaultSubobject<USkeletalMeshComponent>("TrouserComponent");
> Component14->SetupAttachment(RootComponent);
> 
> ```

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/5/d05fbc4d8289b4240a5ae2777e1a4ee7b070b8e6.png)

The only workaround I found was creating all components then attaching them in a specific order, one by one, to another component.

By the way this is not a good solution because it’s not scalable and if you add component in BP they are added in a random point and in a random order.

My suggestion is to create an array of scene components pointers and add every component to it when you create it:

> **.h file**
>
> ```auto
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> USceneComponent* NewRoot;
> 
> UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Components")
> TArray<USceneComponent*> OrderedComponents;
> 
> ```

> **.cpp file**
>
> ```auto
> NewRoot = CreateDefaultSubobject<USkeletalMeshComponent>("NewRoot");
> NewRoot->SetupAttachment(GetRootComponent());
> 
> Component1 = CreateDefaultSubobject<USkeletalMeshComponent>("AntennaeComponent");
> OrderedComponents.Add(Component1);
> 
> Component2 = CreateDefaultSubobject<USkeletalMeshComponent>("BladeComponent");
> OrderedComponents.Add(Component2);
> 
> Component3 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestAdditionComponent");
> OrderedComponents.Add(Component3);
> 
> Component4 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestComponent");
> OrderedComponents.Add(Component4);
> 
> Component5 = CreateDefaultSubobject<USkeletalMeshComponent>("GauntletComponent");
> OrderedComponents.Add(Component5);
> 
> Component6 = CreateDefaultSubobject<USkeletalMeshComponent>("GemComponent");
> OrderedComponents.Add(Component6);
> 
> Component7 = CreateDefaultSubobject<USkeletalMeshComponent>("GloveComponent");
> OrderedComponents.Add(Component7);
> 
> Component8 = CreateDefaultSubobject<USkeletalMeshComponent>("HornComponent");
> OrderedComponents.Add(Component8);
> 
> Component9 = CreateDefaultSubobject<USkeletalMeshComponent>("KabutoComponent");
> OrderedComponents.Add(Component9);
> 
> Component10 = CreateDefaultSubobject<USkeletalMeshComponent>("NeckComponent");
> OrderedComponents.Add(Component10);
> 
> Component11 = CreateDefaultSubobject<USkeletalMeshComponent>("NecklaceComponent");
> OrderedComponents.Add(Component11);
> 
> Component12 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderAdditionComponent");
> OrderedComponents.Add(Component12);
> 
> Component13 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderComponent");
> OrderedComponents.Add(Component13);
> 
> Component14 = CreateDefaultSubobject<USkeletalMeshComponent>("TrouserComponent");
> OrderedComponents.Add(Component14);
> 
> // Do a for loop in OrderedComponents starting from the last value
> //for(int Index = OrderedComponents.Num()-1; Index >= 0; Index--)
> //{
> //	OrderedComponents[Index]->SetupAttachment(NewRoot);
> //}
> 
> for(USceneComponent* Component : OrderedComponents)
> {
> Component->SetupAttachment(NewRoot);
> }
> 
> ```

As you can see the components are now ordered, but from the last to the first, if you look inside the .cpp file, I also tried to attach them from the last to the first with a reverse foreach loop but the order remains the same (very strange)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/c/e3c28ef16421aa698ba5fd0db7c0b81da2966026.png)

The Order in which you declare the components in the .h file doesn’t matter, the order in which you add them to array also doesn’t matter, it looks like it only cares about the creation order, so…

This ■■■■■■■■ (Components created from last to first, and then added to the array in a random order):

```auto
	NewRoot = CreateDefaultSubobject<USkeletalMeshComponent>("NewRoot");
	NewRoot->SetupAttachment(GetRootComponent());

	Component14 = CreateDefaultSubobject<USkeletalMeshComponent>("TrouserComponent");
	Component13 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderComponent");
	Component12 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderAdditionComponent");
	Component11 = CreateDefaultSubobject<USkeletalMeshComponent>("NecklaceComponent");
	Component10 = CreateDefaultSubobject<USkeletalMeshComponent>("NeckComponent");
	Component9 = CreateDefaultSubobject<USkeletalMeshComponent>("KabutoComponent");
	Component8 = CreateDefaultSubobject<USkeletalMeshComponent>("HornComponent");
	Component7 = CreateDefaultSubobject<USkeletalMeshComponent>("GloveComponent");
	Component6 = CreateDefaultSubobject<USkeletalMeshComponent>("GemComponent");
	Component5 = CreateDefaultSubobject<USkeletalMeshComponent>("GauntletComponent");
	Component4 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestComponent");
	Component3 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestAdditionComponent");
	Component2 = CreateDefaultSubobject<USkeletalMeshComponent>("BladeComponent");
	Component1 = CreateDefaultSubobject<USkeletalMeshComponent>("AntennaeComponent");

	OrderedComponents.Add(Component6);
	OrderedComponents.Add(Component3);
	OrderedComponents.Add(Component7);
	OrderedComponents.Add(Component13);
	OrderedComponents.Add(Component12);
	OrderedComponents.Add(Component14);
	OrderedComponents.Add(Component10);
	OrderedComponents.Add(Component5);
	OrderedComponents.Add(Component1);
	OrderedComponents.Add(Component8);
	OrderedComponents.Add(Component2);
	OrderedComponents.Add(Component4);
	OrderedComponents.Add(Component9);
	OrderedComponents.Add(Component11);

	for(USceneComponent* Component : OrderedComponents)
	{
		Component->SetupAttachment(NewRoot);
	}

```

Returns this perfectly ordered list:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/c/8fc560c644f1356367c67d2618310c992118b990.png)

Now, if I create some components from BP, they are automatically added in the middle of the list and destroy the order of other components placed in C++ (PURE NONSENSE 🤯):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/6/a96afd4fd80a91720b870eb88c36ecd20c109cce.png)

You won’t be able to reorder them in the BP constructor because it’s not a real constructor, as you can see nothing happens:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/e/d5e43dc2f9151aab734a1fe53ad10f653766992d.png)

The only “working” solution is creating all the components in C++ and avoid touching them in BPs as much as possible if you want to keep a decent order

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [January 11, 2023, 7:43am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/4 "2023-01-11T07:43:41Z")

</div>

Thanks for the detailed reply, my experience is

1. even in C++, the order is not defined if you add components
2. The drag drop for scene components doesn’t work for components with children. It just orders them in a random order when moving them around

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [January 11, 2023, 7:45am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/5 "2023-01-11T07:45:08Z")

</div>

Shorter version:

Just add the actor to the array directly when you create it (It will drastically reduce the number of lines and improve readability and scalability):

```auto
	NewRoot = CreateDefaultSubobject<USkeletalMeshComponent>("NewRoot");
	NewRoot->SetupAttachment(GetRootComponent());

	OrderedComponents.Add(Component14 = CreateDefaultSubobject<USkeletalMeshComponent>("TrouserComponent"));
	OrderedComponents.Add(Component13 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderComponent"));
	OrderedComponents.Add(Component12 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderAdditionComponent"));
	OrderedComponents.Add(Component11 = CreateDefaultSubobject<USkeletalMeshComponent>("NecklaceComponent"));
	OrderedComponents.Add(Component10 = CreateDefaultSubobject<USkeletalMeshComponent>("NeckComponent"));
	OrderedComponents.Add(Component9 = CreateDefaultSubobject<USkeletalMeshComponent>("KabutoComponent"));
	OrderedComponents.Add(Component8 = CreateDefaultSubobject<USkeletalMeshComponent>("HornComponent"));
	OrderedComponents.Add(Component7 = CreateDefaultSubobject<USkeletalMeshComponent>("GloveComponent"));
	OrderedComponents.Add(Component6 = CreateDefaultSubobject<USkeletalMeshComponent>("GemComponent"));
	OrderedComponents.Add(Component5 = CreateDefaultSubobject<USkeletalMeshComponent>("GauntletComponent"));
	OrderedComponents.Add(Component4 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestComponent"));
	OrderedComponents.Add(Component3 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestAdditionComponent"));
	OrderedComponents.Add(Component2 = CreateDefaultSubobject<USkeletalMeshComponent>("BladeComponent"));
	OrderedComponents.Add(Component1 = CreateDefaultSubobject<USkeletalMeshComponent>("AntennaeComponent"));

	for(USceneComponent* Component : OrderedComponents)
	{
		Component->SetupAttachment(NewRoot);
	}

```

The order of the components in the .h file doesn’t matter, just create them from the last to the first and then use SetupAttachment

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [January 11, 2023, 8:00am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/6 "2023-01-11T08:00:43Z")

</div>

> [@imtrobin2](#):
>
> even in C++, the order is not defined if you add components

That’s strange, I tried with different types of components and different names and it works:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/b/f7ba8887d8aca54b538448be3d649fe1a898955c.png)

Are you attaching them to a new component after you create them?

> [@imtrobin2](#):
>
> The drag drop for scene components doesn’t work for components with children. It just orders them in a random order when moving them around

With children you have to repeat the same s\*\*t, with a different array, and yes, the order in which you create them matters (If you create the children before the parent it will be moved to last, really don’t ask me why the f…):

```auto
	TArray<USceneComponent*> OrderedComponents;
	TArray<USceneComponent*> OrderedChildren;

	NewRoot = CreateDefaultSubobject<USkeletalMeshComponent>("NewRoot");
	NewRoot->SetupAttachment(GetRootComponent());
	OrderedComponents.Add(Component11 = CreateDefaultSubobject<USkeletalMeshComponent>("NecklaceComponent"));
	OrderedComponents.Add(Component10 = CreateDefaultSubobject<USkeletalMeshComponent>("NeckComponent"));
	OrderedComponents.Add(Component9 = CreateDefaultSubobject<USkeletalMeshComponent>("KabutoComponent"));
	OrderedComponents.Add(Component8 = CreateDefaultSubobject<USkeletalMeshComponent>("HornComponent"));
	OrderedComponents.Add(Component7 = CreateDefaultSubobject<USkeletalMeshComponent>("GloveComponent"));
	OrderedComponents.Add(Component6 = CreateDefaultSubobject<USkeletalMeshComponent>("GemComponent"));
	OrderedComponents.Add(Component5 = CreateDefaultSubobject<USkeletalMeshComponent>("GauntletComponent"));
	OrderedComponents.Add(Component4 = CreateDefaultSubobject<USkeletalMeshComponent>("ChestComponent"));
	OrderedComponents.Add(ComponentIII = CreateDefaultSubobject<USceneComponent>("ChestAdditionComponent"));
	OrderedComponents.Add(SecondComponent = CreateDefaultSubobject<UStaticMeshComponent>("BladeComponent"));
	OrderedComponents.Add(Component1 = CreateDefaultSubobject<USkeletalMeshComponent>("AntennaeComponent"));

	OrderedChildren.Add(Child3 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderAdditionComponent"));
	OrderedChildren.Add(Child2 = CreateDefaultSubobject<USkeletalMeshComponent>("ShoulderComponent"));
	OrderedChildren.Add(Child1 = CreateDefaultSubobject<USkeletalMeshComponent>("TrouserComponent"));

	for(USceneComponent* Component : OrderedChildren)
	{
		Component->SetupAttachment(SecondComponent);
	}

	for(USceneComponent* Component : OrderedComponents)
	{
		Component->SetupAttachment(NewRoot);
	}

```

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [January 11, 2023, 8:04am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/7 "2023-01-11T08:04:13Z")

</div>

I see. I was doing a bit differently. I was previously actor component, and the ordering didn’t work (in C++), I switched them to scene component. Then I was organizing it into scene nodes (with children). Moving them around screws up.

I was thinking of a editor tool to clone the components , remove , sort them by name and add them back.

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [January 11, 2023, 8:06am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/8 "2023-01-11T08:06:33Z")

</div>

> [@imtrobin2](#):
>
> I was thinking of a editor tool to clone the components , remove , sort them by name and add them back.

If you manage to do it, I’d be very happy to use it! (even if I think that this is a huge engine issue and Epic should fix it…)

> [@imtrobin2](#):
>
> I was previously actor component, and the ordering didn’t work (in C++), I switched them to scene component.

If you mean UChildActorComponent it works fine for me, I also tried with a UCameraComponent and the order seems to work, if you add stuff in BP everything will break:

Before adding components in BP:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/6/a3671c5edc2db319c096b3830ba887b7ffc27100.png)

After:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/7/d7732c236816d6799c6ac156de1dfc4fede5ccd7.png)

It’s simply ridiculous!

If you mean any subclass of UActorComponent, bad luck, since they can’t be attached to a parent and this topic it’s still unsolved despite it’s been created in 2016: [Blueprint component reordering](https://forums.unrealengine.com/t/blueprint-component-reordering/359886/10).  
It looks like nobody cares about ordering components at all…

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [January 11, 2023, 10:02am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/10 "2023-01-11T10:02:29Z")

</div>

Are you sure C++ actorcomponents work? I tried before (as a test) insert new components in middle, the order is random.

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [January 11, 2023, 10:04am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/11 "2023-01-11T10:04:28Z")

</div>

You probably missed my answers because of the wall of text:

> [@Ares9323](#):
>
> If you mean UChildActorComponent it works fine for me

> [@Ares9323](#):
>
> If you mean any subclass of UActorComponent, bad luck

(I tried adding an UActorComponent to my previous code and everything gets messed up, no matter when I create the component)

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [January 11, 2023, 12:48pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/12 "2023-01-11T12:48:36Z")

</div>

oh wow, I didn’t even realize there is ChildActorComponent. I can’t seem to pick them as parent class from blueprint (that’s why I never knew about them). It seems to be a child of scenecomponent, so probably behaves like scene component.

---

<div class="post-metadata">

**Author:** ![fdubiel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fdubiel](https://forums.unrealengine.com/u/fdubiel)\
**Post date:** [February 14, 2024, 4:07pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/13 "2024-02-14T16:07:58Z")

</div>

its a mess even in 5.2, there are a lot of features missing in in the BP editor, symbols for decals for example etc., its a very very simple editor

---

<div class="post-metadata">

**Author:** ![Soraphis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soraphis](https://forums.unrealengine.com/u/Soraphis)\
**Post date:** [April 23, 2024, 10:53am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/14 "2024-04-23T10:53:07Z")

</div>

Just wanna bump, since it is still the same in 5.3 (likely also 5.4 even though I have not looked into it yet).

---

<div class="post-metadata">

**Author:** ![DanSteph](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dansteph/32/936263_2.png) [@DanSteph](https://forums.unrealengine.com/u/DanSteph)\
**Post date:** [May 22, 2024, 11:18pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/15 "2024-05-22T23:18:38Z")

</div>

Still the same in 5.4.  
It’s ridiculous, computers allow to order things since 40 years, peoples complaint in unreal since years and still this simple things is completely ignored by devs.  
It seem we are stuck with blueprint hell forever.

---

<div class="post-metadata">

**Author:** ![Csierp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Csierp](https://forums.unrealengine.com/u/Csierp)\
**Post date:** [May 27, 2024, 4:50pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/16 "2024-05-27T16:50:59Z")

</div>

Why has this not been addressed? Even adding and renaming things as you go doesn’t keep any order - my "DropTarget1/2/3…"s are now spread throughout my DefaultSceneRoot like confetti…

---

<div class="post-metadata">

**Author:** ![Leomerya12](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/leomerya12/32/926321_2.png) [@Leomerya12](https://forums.unrealengine.com/u/Leomerya12)\
**Post date:** [November 10, 2024, 12:21am UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/17 "2024-11-10T00:21:33Z")

</div>

Can an Epic Games Dev explain why this is, clearly, not a possibility at the moment?

I’m sure there is a reason, and I’d like to know why.

---

<div class="post-metadata">

**Author:** ![Hannes821](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hannes821/32/1044901_2.png) [@Hannes821](https://forums.unrealengine.com/u/Hannes821)\
**Post date:** [November 10, 2024, 7:38pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/18 "2024-11-10T19:38:36Z")

</div>

please find a solution, Epic. #support

---

<div class="post-metadata">

**Author:** ![sandermann](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sandermann/32/1157591_2.png) [@sandermann](https://forums.unrealengine.com/u/sandermann)\
**Post date:** [January 3, 2025, 8:18pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/19 "2025-01-03T20:18:42Z")

</div>

This is annoying.

I copied all components pasted in text editor. there is nothing from where it could get order information, just the lines itself. so i reorginized it that all components where sorted and copied from the text editor and pasted back in components. no luck.  
Then i created a complete new bp and pasted it there. no luck. i mean the paste from the texteditor copy worked but its not ordered like in the text editor.  
so it seems that something is somewhere saved deep in the engine or project code which takes the order information.

i also would like to hear from epic why we can not just have something like a reorder submenu element, that just would simply reorder by name.

---

<div class="post-metadata">

**Author:** ![PeterW\_art](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PeterW\_art](https://forums.unrealengine.com/u/PeterW_art)\
**Post date:** [January 28, 2025, 10:17pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/20 "2025-01-28T22:17:07Z")

</div>

What I find to be the strangest thing about all of this is that people working with Unreal in epic games don’t seem to mind? This would clearly not be difficult to fix, so if devs working internally complained about it, it would get fixed, but… nobody cares there 💀

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [January 28, 2025, 10:47pm UTC](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499/21 "2025-01-28T22:47:25Z")

</div>

> [@PeterW\_art](#):
>
> What I find to be the strangest thing about all of this is that people working with Unreal in epic games don’t seem to mind?

I think they probably gave up, there are so many nonsense things in the engine that every UE dev I know personally doesn’t even feel like wasting his time opening a ticket or contacting the support…

I admit I have a heavy OCD so this disturbs me enormously, I’m also triggered by naming inconsistencies [like this](https://github.com/EpicGames/UnrealEngine/pull/10796#issuecomment-2581085495), I even sent a pull request and it took them 1.5Y to reject it… It was just a wrong string 😅🤣

* * *

> [@PeterW\_art](#):
>
> This would clearly not be difficult to fix

The component order is a different thing as far as I understood speaking with a guy on the Unreal Discord (2.5 years after I opened this thread), it’s probably due to multi-threading and how component are generated while creating the BP (so they can be shuffled every time according to the time they take during their construction, it’s like the first thing that you have to take in account when you use multi-threading but let’s pretend it’s not 😓).

Honestly, I kinda gave up too, I was very active on this forum (I even got the 365 consecutive logins badge) and in the Unreal community or reporting bugs, but why should I continue if nobody seems to care? Why should I waste my time trying to fix something in the engine if they are probably going to refuse it 2 years later?

As a marketplace seller I’m even more disappointed:

- Fab is a mess
- At every minor release something breaks in C++
- Slate icons are constantly moved in different folders and they disappear from buttons
- Modules are moved in other folders and the #includes are different
- Sometimes you need to add in the build.cs modules that weren’t necessary in the previous version
- You get random bugs like [this](https://forums.unrealengine.com/t/plugin-no-longer-saves-settings-in-5-5/2139463) (it took me two months to understand the fix, not the cause yet)

Sorry for my frustration, but I kinda understand now why this issue is still not fixed… 😅

[Next page](https://forums.unrealengine.com/t/how-to-sort-scene-components-alphabetically-or-at-least-reorder-them/576499.md?page=2)
