How can I add array of subobjects?

Normally if I want to add a single subobject I would do this.

// .h

SomeComponentType*  aComponent;

// .cpp

aComponent = CreateDefaultSubobject<SomeComponentType>(TEXT("a name"));

But what if I want to add an array that I intend to dynamically add objects to?

I created a UStruct that housed a

TArray<SomeComponent*> myCompArray;

Then I made that Ustruct a UPROPERTY(). Instead of using CreateDefaultSubobject to add the object in the constructor, I used


to add the object outside the constructor. “this” being the UObject it’s attaching to.