Failing to copy/paste a TArray UPROPERTY?

Hi,

I’m having an issue with a TArray property.

I was inspired by the AI Perception Component to create a configuration property for my actors that would be an array of pointers to a UObject base class. In the editor, the user is then able to select a configuration in the dropdown list between all the child classes of this base class. It works great !

But when I try to copy/paste this array to another actor (especially in another level), all the pointers become None. :frowning:

I wonder if this is an engine bug or if I’m doing something wrong.

My property looks like that :

UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, Category = MetaFSM, meta = (AllowPrivateAccess = "true"))
TArray<UBaseStateDescriptor*> StatesArray;

and my base class is declared like that :

UCLASS(Blueprintable, DefaultToInstanced, collapsecategories, hidecategories = Object, editinlinenew, abstract)
class XAO_API UBaseStateDescriptor : public UObject

technically it makes sense for Unreal not to copy pointer data and so it sets everything back to null. I’d just like it to make a deep copy, but I don’t know if I’m missing a parameter somewhere or anything.

I thought that “Instanced” would be the answer to my problem but it doesn’t fix it.

Any help will be appreciated ! :slight_smile: