I have a USceneComponent I’m attaching to Actors/Pawns in the editor (currently just using the empty pawn). The USceneComponent creates a UStaticMeshComponent in the contrusctor and attaches it to the USceneComponent.
UDisplayBase::UDisplayBase()
{
PrimaryComponentTick.bCanEverTick = true;
// Create the static mesh subcomponent
DisplaySurface = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("DisplaySurface"));
DisplaySurface->SetupAttachment(this);
}
If I then right click and delete the DisplayBase object within the editor then it Promotes the UStaticMeshComponent up to be a direct child of the DefaultSceneRoot and I am not able to delete it.
I have identical behaviour with another of my custom USceneComponent classes so I’m clearly missing a step here. Is anyone able to provide an example of how to properly handle the delete process? I can see DestroyComponent but not certain this is the answer I’m looking for. Feel more like I haven’t quite got my structure setup correctly.
Child component promoted and now unable to delete. It is deleted if I delete the Pawn.