# Nested Structures

**URL:** <https://forums.unrealengine.com/t/nested-structures/1170037>\
**Category:** Blueprint\
**Tags:** data-structures, Structure, unreal-engine, UE5, Blueprint, question\
**Created:** [May 18, 2023, 4:06pm UTC](https://forums.unrealengine.com/t/nested-structures/1170037 "2023-05-18T16:06:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![T4l\_R](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@T4l\_R](https://forums.unrealengine.com/u/T4l_R)\
**Post date:** [May 18, 2023, 4:06pm UTC](https://forums.unrealengine.com/t/nested-structures/1170037/1 "2023-05-18T16:06:59Z")

</div>

Hi all,  
Having an issue here and I’ve reached a dead end:  
I want to be able to save and load a complex array. The array type is an object I created that include within it an array of himself (object A contains an array of type object A). I know my only way to be able to save object A is to save its variables in a structure and on load to create the object with the saved parameters from the structure. The thing is a structure can’t include itself in it (so there won’t be an infinite loop).  
What would be the best way to make something similar to this?

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [May 18, 2023, 4:28pm UTC](https://forums.unrealengine.com/t/nested-structures/1170037/2 "2023-05-18T16:28:34Z")

</div>

There is no way to do this cleanly. You’ll have to create an identical struct.

There is, however, likely a better way to structure your save data so that this isn’t necessary. Could you elaborate on what you’re trying to do?

---

<div class="post-metadata">

**Author:** ![T4l\_R](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@T4l\_R](https://forums.unrealengine.com/u/T4l_R)\
**Post date:** [May 18, 2023, 5:17pm UTC](https://forums.unrealengine.com/t/nested-structures/1170037/3 "2023-05-18T17:17:27Z")

</div>

I’m trying to create an array, save it and load it when game is starting.  
The array contains object A. Object A contains an array of object As in it. That way each element in the array can split to separate branches.  
For saving, I tried creating two structures: One that contains the parameters of the object I’m trying to save (let’s call it Structure A) and another structure that contains Structure A and an array of Structure As.  
I think the save part works, but loading is a problem.
