Hi,
We’ve been experiencing the following issue.
Non-scene UActorComponent subclasses created with CreateDefaultSubobject in C++ can incorrectly appear in the scene component hierarchy section of the Blueprint editor’s Components panel, instead of in the Actor Components section below the separator.
The bug is name-dependent:
- Actor components with names alphabetically before the root scene component’s name → incorrectly placed above separator
- Actor components with names alphabetically after the root scene component’s name → correctly placed below separator
Example from our codebase:
- Root scene component: PawnCollision0 (starts with “P”)
- NavigationInvokerComponent (starts with “N”) → appeared above separator (BUG: “N” < “P”)
- FlyComponent (starts with “F”) → appeared below separator (by chance, due to sort algorithm)
Root Cause
The bug is in FFBlueprintEditorDefaultSortUICustomization::SortSubobjectData in BlueprintEditorSCSEditorUICustomization.cpp.
The sort comparator correctly handles the case where A is a scene component and B is not:
if (A.GetData()->IsSceneComponent())
{
if (B.GetData()->IsSceneComponent())
{
return A.GetData()->GetDisplayName().CompareTo(B.GetData()->GetDisplayName()) < 0;
}
return !B.GetData()->IsActor(); // A (scene) comes before B (non-scene)
}
However, it does NOT handle the inverse case where A is NOT a scene component but B IS a scene component. Instead, it falls through to alphabetical comparison.
This creates a non-transitive comparator.
When the actor component’s name is alphabetically less than a scene component’s name (e.g., “NavigationInvokerComponent” < “PawnCollision”), the comparator incorrectly returns true, placing the actor component before the scene component.
[Attachment Removed]