It seems there is a bug (or at least I think it is a bug) with having a UProperty TArray that is declared as Instanced, eg:
UPROPERTY(Instanced, EditDefaultsOnly)
TArray<UItem*> List;
In the editor, any items that are added to the list get reset to none when you compile the blueprint.
I started a new project to test this and so far it has just two classes in it: AHolder and UItem.
AHolder just has an array of UItems in it.
AHolder:
UCLASS(Blueprintable)
class TESTPROJECT_API AHolder : public AActor
{
GENERATED_BODY()
public:
UPROPERTY(Instanced, EditDefaultsOnly)
TArray<UItem*> List;
};
UItem:
UCLASS(EditInlineNew)
class TESTPROJECT_API UItem : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere)
FString Name;
};
This is what happens in the editor:
Before compilation:
After compilation:
Is this a bug? Or is something else going on?
A very similar question has been posted [here][3], but they never got an answer so I am asking again.