Unreal engine foes not load data from a saved file on a mac

When i save the array into the slot:

  • The print string shows the items are in the array in the blueprint
  • The print string shows the items are in the array in the SaveGame object

When i load from the slot (not stop playing) :

  • The print string shows the items are in the array in the SaveGame object

When i go to saved game file directory:

  • I can see the file and when opened with the text editor i can see the objects names in the array in text

BUT when i stop game, start play, and load game:

  • Items are not existing anymore in the SaveGame file. the array Length is right, but it is loaded with empty slots without any objects.

Arrays are of a parent class but the items are a child (2 grades ) of that parent. does that mess the function ? should work …

I dont know how to solve this, would love to have help, i am using setup correctly, i make sure of that many times using epic’s tutorials

1 Like

If you can see the data in the save file after exiting, but it’s gone when you reload the game, I’m guessing you have to be overwriting it somehow…

Because even if there is some sort of bug in the engine for mac, you don’t need to write to the save game to read it on game start.

The file is there with the data regardless if i stop game or not (after save)
But its only load properly as long as i don’t stop game

I use delete save slot function with button every time i want to test fresh, only then the file will delete as expected

1 Like

Could you show the code?

i can later (its a lot of print string nodes so a lot of screenshots)
But there is nothing special. Just copy paste of all the tutorials with the bare minimum of example.

This is what ChatGpt gave me:

You’re running into a classic Unreal gotcha:

  • During the same PIE session, your array holds live pointers to level actors. Loading “works” because those exact objects still exist in memory and the PIE path (notice UEDPIE_0_…) is valid.

  • After you stop PIE, those actor instances are destroyed. On the next run, Unreal can’t resolve those old PIE-scoped object references, so it recreates the array with the same length but the entries are None (null).

That’s why you see entries like:

/Game/Levels/UEDPIE_0_Testing_Inventory:PersistentLevel.Base_inventory_Bow_sWindArchBlack_C_3

Those are transient, session-specific paths that won’t exist next time.

How to fix it (Blueprint-friendly)

Don’t save live actor/object pointers. Save reconstructable data, then resolve/spawn on load.

Common patterns:

  1. For items you can spawn
  • Save a Soft Class Reference (the item’s Blueprint class), plus Transform and any per-item state (qty, durability, etc.).

    • BP variable types: Soft Class Reference, Transform, int/float/structs.
  • On load, use “Load Class Asset” (or just use the Soft Class pin) → SpawnActorFromClass → apply saved state.

  1. For actors placed in the level (not spawned)
  • Give each a stable ID (e.g., a Name/String variable, or a unique Tag like ItemID:Bow01).

  • Save that ID (not the pointer).

  • On load, Find it (e.g., Get All Actors With Tag or an interface function that returns the actor’s ID) and rebuild your array from the matches.

  1. For assets (not actors)
  • Save a Soft Object Reference to the asset (textures, data assets, etc.). Soft refs serialize as paths independent of PIE.

  • On load, “Load Asset” and use it.

Minimal C++ idea (if you use C++)

USTRUCT(BlueprintType)
struct FInventoryEntry
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
    TSoftClassPtr<AActor> ItemClass;  // spawnable class

    UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
    FTransform SpawnTransform;

    UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
    FName ItemID; // for placed actors or logical identity

    UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
    int32 Quantity = 1;
};

Then at load:

  • If ItemID is set → find placed actor by ID.

  • Else if ItemClass is set → spawn from class at SpawnTransform.

Quick checklist

  • :white_check_mark: Mark properties with SaveGame (or in BP, ensure the variables you mean to save live on the SaveGame object).

  • :cross_mark: Don’t save Actor or Object references from the world into SaveGame.

  • :white_check_mark: Prefer SoftObject/SoftClass references, IDs, or raw data.

  • :white_check_mark: For level actors, use Tags/IDs to find them next session.

  • :white_check_mark: For spawned actors, spawn from saved class and restore state.

If you show me how your inventory array is defined (types of its elements), I can refactor it into a “soft/ID-based” version and give you the exact BP nodes to swap in.

I arranged the nodes so they fit in 1 function per screenshot

Both array’s named “all inventory items”, one is on the inventory controller and one is on the “MySaveGame” savegame class, saved in V_savegame variable

1 Like

What kind of thing is an inventory item?

( I don’t see anything writing the save game, maybe another screen shot is coming, and yes, you can’t save actor references :wink: ).

So i can only save numbers and strings? no plugin that can save the actor ?

1 Like

It really depends what kind of actor reference you’re talking about.

If you’re spawning things, for instance, no chance saving any of that, obviously it will not be the same the next time around.

I think if you have an actor sitting in the level, yes you could save a reference to it, but why? It won’t save any other information with the reference. If you wanted to save the scale or position or color, you’d need to do that separately.

What sort of use case are we looking at?

If these actors are inventory items you have picked up, then as GPT says, you need to store the class of them. That way you know exactly what it was the next time the game runs, and you can spawn a new one.