Create an abstract component whose type can be determined in the editor

I have a trigger volume in my c++ actor. I want to be able to specify it as a sphere/box/capsule collision in the editor. Right now I’m using this code:


TriggerVolume = CreateDefaultSubobject<UShapeComponent, USphereComponent>(TEXT("Trigger Volume"));

While this gives me a UShapeComponent that defaults to a sphere, when I try to change TriggerVolume to, say, a box in the editor, the box appears as a new child component named BoxComponent_0.

How can I set this up such that when I change the sphere to a box, the box replaces the sphere and becomes the new TriggerVolume property, instead of being added as a new component?