# How to save an inventory array?

**URL:** <https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539>\
**Category:** Blueprint\
**Tags:** loading, inventory, unreal-engine, Array, saving, question\
**Created:** [September 17, 2025, 1:02pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539 "2025-09-17T13:02:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KMzuru](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmzuru/32/88707_2.png) [@KMzuru](https://forums.unrealengine.com/u/KMzuru)\
**Post date:** [September 17, 2025, 1:02pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/1 "2025-09-17T13:02:49Z")

</div>

Hi, I’ve followed a tutorial on creating an inventory system, followed it pretty 1 to 1 so my inventory code works effectively the same ([https://youtu.be/b2atcZWYi3E?si=ynpmm1xGla5mJQky](https://youtu.be/b2atcZWYi3E?si=ynpmm1xGla5mJQky)) and have also already created a working save system in my game. I now want to be able to load/save the stored inventory objects but (being new) can’t seem to figure out how to get it to work. I clasped my hands and prayed it would be as simple as just saving the array, then getting it when loading (screenshots) but expectedly it didn’t work. I couldn’t find anything that would help as I’m not even sure if it’s the saving, the loading, or something in the way the inventory loads the items that is the problem. Help is greatly appreciated.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/6/77657f7c11e4f0533e37cdbfc5c51a5e1c2353ea.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/f/b4f6eb2e5e5abdbec060bf7cdb6435f0620e94fb.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/1/ff1b19d77fd6f3bbb44d9956516d5c2758f2fe2a.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [September 17, 2025, 1:28pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/2 "2025-09-17T13:28:05Z")

</div>

where are you actually saving it though, ie the SaveGameObject and writing/reading from disk?

---

<div class="post-metadata">

**Author:** ![KMzuru](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmzuru/32/88707_2.png) [@KMzuru](https://forums.unrealengine.com/u/KMzuru)\
**Post date:** [September 17, 2025, 1:37pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/3 "2025-09-17T13:37:21Z")

</div>

Saving the information to a structure, which is saved/loaded in the game instance

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/4/314e2c2653750ab3011fbb416197bd94093adaf1.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/5/d751c7f3c678a7149825f271fd0de4df85cdb458.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/c/d4c9dcde403dd8a9145f632dc2804b8bbeab94d3.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [September 17, 2025, 1:45pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/4 "2025-09-17T13:45:28Z")

</div>

it looks ok from what i can see, although dont forget to call OnLoaded on your non Async path.

so to delve deeper, what error/problem are you getting?

---

<div class="post-metadata">

**Author:** ![KMzuru](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmzuru/32/88707_2.png) [@KMzuru](https://forums.unrealengine.com/u/KMzuru)\
**Post date:** [September 17, 2025, 1:51pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/5 "2025-09-17T13:51:02Z")

</div>

I’m not getting any particular errors, the problem is when the game is saved, closed then loaded the items I picked up and had in my inventory aren’t there anymore. The question is quite general as they are stored in an array, and I don’t know how to save and load arrays at all (or even print them for debugging for that matter), so I’m not sure where the problem lies. The youtube video I linked is the inventory tutorial I followed so that may help but I’m not sure. I have to sleep now so I may not respond for a bit.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [September 17, 2025, 2:51pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/6 "2025-09-17T14:51:17Z")

</div>

so what calls LoadGameData?

youre calling a dispatcher OnGameLoaded, but who is listening and do they exist at that point?

do the Casts fail?

---

<div class="post-metadata">

**Author:** ![illspiritx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illspiritx](https://forums.unrealengine.com/u/illspiritx)\
**Post date:** [September 17, 2025, 7:06pm UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/7 "2025-09-17T19:06:00Z")

</div>

Setting an array var from a saved copy like you did should work. I’ve done it before. To debug it, use a foreachloop, break the struct, then print one of the members:

 ![PrintInvArray](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/c/6cc0e8aec75377dd7f2b41fcae167a9075eea35f.jpeg)

Try that on save function also to make sure it’s actually saving teh array.

---

<div class="post-metadata">

**Author:** ![KMzuru](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmzuru/32/88707_2.png) [@KMzuru](https://forums.unrealengine.com/u/KMzuru)\
**Post date:** [September 18, 2025, 1:31am UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/8 "2025-09-18T01:31:18Z")

</div>

Managed to save it due to the help of the debugging blueprint, the issue lied with the loading of the inventory iteself in the widget, just had to change it a bit to load the saved inventory properly.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/c/9/3c91d425ebd9f4657a4cabcc55e55cceafa8f2c7.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/8/e28b4ce373815ebbcb8617ac63e7b3df37e449df.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/9/3d9a725196c3c5045dfcd92e3e1f8310712b2fb0.png)

---

<div class="post-metadata">

**Author:** ![SaraCastrol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SaraCastrol](https://forums.unrealengine.com/u/SaraCastrol)\
**Post date:** [September 18, 2025, 3:30am UTC](https://forums.unrealengine.com/t/how-to-save-an-inventory-array/2657539/9 "2025-09-18T03:30:03Z")

</div>

You can refer to:

 ![save_load_inventory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/f/dcfbc75757e6628a306dbfc56a6f6f1ffb725d8a.png)
