Struct not serializing to savefile

Fixing all my rookie mistakes, there's still issues with serialization/de-serialization of more complex data structures it seems. Attaching debugger to PreSaveGame and PostLoadGame it's clear that they're present on save but not present on load

void AResourceRouletteSubsystem::PreSaveGame_Implementation(int32 SaveVersion, int32 GameVersion)
{
    SavedSeed = SessionSeed;
    SavedAlreadySpawned = SessionAlreadySpawned;
    SavedRandomizedResourceNodes = SessionRandomizedResourceNodes;
}

void AResourceRouletteSubsystem::PostLoadGame_Implementation(int32 SaveVersion, int32 GameVersion)
{
    if (SavedSeed != -1)
    {
        SessionSeed = SavedSeed;
    }
    if (SavedAlreadySpawned)
    {
        SessionAlreadySpawned = SavedAlreadySpawned;
    }
    if (SavedRandomizedResourceNodes.Num() > 0)
    {
        SessionRandomizedResourceNodes = SavedRandomizedResourceNodes;
    }
}

UPROPERTY(SaveGame)
int32 SavedSeed;

UPROPERTY(SaveGame)
bool SavedAlreadySpawned = false;;

UPROPERTY(SaveGame)
TArray<FResourceNodeData> SavedRandomizedResourceNodes;


I've set the specifier for it 🤔
SavedSeed and SavedAlreadySpawned are int32 and bool respectively with similar setups and these work properly
image.png
Solution
In case you haven't solved this yet, the uproperties in the struct must be marked as savegame too
Was this page helpful?