Erase old component on creating new one through editor propperties

Hello!

I’m new to unreal, so please be gentle with me, it’s probably trivial question, but I can’t seen to find an answer.

I have a c++ class with a upropperty that can hold several different types of components derived from a UEnvironmentObjectTriggerBase parrent class. It is written like this:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Spawning”)
class UEnvironmentObjectTriggerBase* Trigger;

I was hoping to be able to change the trigger classes from the drop down list in the editor’s property menu for easy usage. It sort of works, but I’m experiencing two problems. First, when I switch to a different class type, old one is not destroyed, but remains attached to the owning object. Secondly, when I try editing newly created child component through the component list, everything is greyed out and I get a “native components are editable when declared as a Uproperty in c++” message. Is there perhaps some UPROPERTY parameter I need to set for it to work as I’m hoping, or perhaps some kind of event I can use to manually destroy old compponent and make new one editable, or am I doing everything wrong?

Thanx in advance!