1
\$\begingroup\$

I have a UProperty in struct which is a TArray<UCoverInfo*> where UCoverInfo is inherited from UObject:

UPROPERTY(Instanced, EditInstanceOnly, BlueprintReadWrite, Category = "CoverPoints")
        TArray<UCoverInfo*> HalfBodyCoverPoints;

I found that when I save map and then reload it, all elements of this array lost their data and get the default values (for i.e. FVector::ZeroVector for FVector fields). And I need to generate this points again. And I will lost everything after the next map reload.

So, how to correctly save and load this UPROPERTY? I need an example of serialization functions for save and load at C++.

\$\endgroup\$
1
  • \$\begingroup\$ I see you have an array of pointers. Could raise a couple of issues, if they are constructed with new they could be garbage collected by Unreal, and if they are referenced in another container then that will not be reflected in your save/load. \$\endgroup\$
    – Jay
    Dec 16 '21 at 23:44

You must log in to answer this question.

Browse other questions tagged .