Why Member variables is invalid?

Hi,guys.i need some help.
My Actor Class have a UObject Member variables,This Member variables have two TArray Member variables.But when debugging, one of the displays is invalid,There are even times when both are ineffective.
Here’s a pseudo-code to express the structure:
Class ATerrainGenerator {
UJCVoronoiGenerator* JCVoronoiGenerator {
// "FJCVoronoiCell,FJCVoronoiEdge " they are Struct.
TArray<FJCVoronoiCell> Cells;
TArray<FJCVoronoiEdge> Edges;
}
}

this’s my Dugbugging picture:

I initialized JCVoronoiGenerator in the constructor:

Then use it in BeginPlay():

Your JCVoronoiGenerator is being garbage collected because it doesn’t have the UPROPERTY macro ahead of it in the member declaration.

1 Like

Yes,you are so good,thank you. :smiling_face_with_three_hearts:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.