# Game Instance is not saving array

**URL:** <https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898>\
**Category:** Blueprint\
**Tags:** savegame, game-instance, game-state, unreal-engine, Blueprint, question\
**Created:** [June 9, 2025, 9:44pm UTC](https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898 "2025-06-09T21:44:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweeetjd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweeetjd/32/782492_2.png) [@sweeetjd](https://forums.unrealengine.com/u/sweeetjd)\
**Post date:** [June 9, 2025, 9:44pm UTC](https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898/1 "2025-06-09T21:44:19Z")

</div>

I am trying to make my game remember the level state between deaths.

Right now, it works as follows:

- Collected items and destroyed objects are stored in the game state temporarily.
- When the player reaches a checkpoint, items and objects are pushed to the game instance so that they can be removed from the level if the player dies and counted on level completion
- At the end of the level, objects and items on the game instance are saved to a save file.

Retrieving variables on respawn isn’t normally an issue, for some reason the array of objects is empty when I try to retrieve it from the game instance after respawning.

---

<div class="post-metadata">

**Author:** ![callfreak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@callfreak](https://forums.unrealengine.com/u/callfreak)\
**Post date:** [June 9, 2025, 10:48pm UTC](https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898/2 "2025-06-09T22:48:53Z")

</div>

Maybe a silly question, but as I understand: Your have an array of objects right? And correct me if im wrong but wouldnt these objects and actors you are referencing to, removed after reloading your level?

But someone maybe correct me 😅

I usually use Structs to save objects to a file

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [June 9, 2025, 10:50pm UTC](https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898/3 "2025-06-09T22:50:27Z")

</div>

Hey @sweeetjd! Been a minute.

So you said you were pushing the object array to the Game Instance.

Could you show the code for how you’re doing that? It’s possible you’re overwriting the array?

Also make sure you’re not loading up a different game instance file (it’s possible).

But yeah the code for how you’re doing this! Just so we can see how you’re going about this to be able to understand what could be going wrong. 🙂

---

<div class="post-metadata">

**Author:** ![sweeetjd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweeetjd/32/782492_2.png) [@sweeetjd](https://forums.unrealengine.com/u/sweeetjd)\
**Post date:** [June 9, 2025, 10:56pm UTC](https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898/4 "2025-06-09T22:56:45Z")

</div>

That makes a lot of sense. I was trying to avoid saving to a file just because I’ve had so much confusion with it in the past but now that you say that, I’m not sure how it could be done any other way. Thanks!

---

<div class="post-metadata">

**Author:** ![sweeetjd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweeetjd/32/782492_2.png) [@sweeetjd](https://forums.unrealengine.com/u/sweeetjd)\
**Post date:** [June 9, 2025, 10:58pm UTC](https://forums.unrealengine.com/t/game-instance-is-not-saving-array/2548898/5 "2025-06-09T22:58:32Z")

</div>

Hey @mind-brain yeah it has, finally have time to make games again!

I think callfreak is right. If the level is resetting then the objects no longer exist to be referenced. I’m going to try using a saved game instead.
