Summary
Ensure “Owner (…) is not selected” fires in FComponentElementSelectionInterface / gizmo recalculation (GetNormalizedElements) when a scene component is destroyed programmatically while it is selected in the editor viewport, because the destroyed component is not removed from the editor’s component selection set.
When an actor (or a component subtree) is destroyed programmatically — e.g. via AActor::Destroy() or UActorComponent::DestroyComponent() called from game code, editor utilities, or PostLoad cleanup — while one of its scene components is selected in the Level Editor, the owner actor is removed from the selection set but the selected child scene components remain in GEditor->GetSelectedComponents().
The next time the viewport recalculates the transform gizmo (GetNormalizedElements), the stale selection triggers the ensure:
Ensure condition failed: … Owner (…) is not selected
Editor-driven deletion paths (Outliner delete, UUnrealEdEngine::DeleteActors, undo/redo transactions) correctly clean up the selection set, but programmatic destruction via the public DestroyComponent() API does not. Since DestroyComponent() is a public API that can legitimately be called at any time, UActorComponent::OnComponentDestroyed() (or the selection system) should defensively deselect the component and its children.
As a workaround, we currently override OnComponentDestroyed() in our components and manually call USelection::Deselect() for the component and all of its child scene components before destruction.
What Type of Bug are you experiencing?
Editor
Steps to Reproduce
- Create an actor with a custom scene component hierarchy (e.g. a root component with child mesh components).
- Place the actor in a level.
- Select one of the child scene components in the Level Editor viewport or the Details panel component tree.
- Destroy the component (or its owner actor) from code — for example, call DestroyComponent() from a console command, an editor utility, or during PIE on the editor-world instance.
- Move the mouse over the viewport or interact with the transform gizmo so the selection is re-evaluated.
Expected Result
The destroyed component is automatically removed from the editor component selection set. No ensure is triggered, and the gizmo updates gracefully.
Observed Result
The destroyed (trashed / garbage) component remains in the component selection set. The ensure “Owner (…) is not selected” fires during gizmo normalization (GetNormalizedElements), and the selection/gizmo state becomes inconsistent until the user clicks to reselect something.
Affects Versions
5.4
Platform(s)
Windows