# \[BUG\] Array Members in Arrays of Structs Just Plain Don't Work

**URL:** <https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 29, 2016, 11:33am UTC](https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617 "2016-08-29T11:33:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ambershee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ambershee](https://forums.unrealengine.com/u/ambershee)\
**Post date:** [August 29, 2016, 11:33am UTC](https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617/1 "2016-08-29T11:33:24Z")

</div>

Title is a bit of a mouthful, so in less concise terms and a picture paints a thousand words:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/1/291f8ad9ce256e2f62602dabd0c158d023816dfb.png) ](https://snipboard.io/gObjSv.jpg)

If you have a struct with an array as a member, then create an array of those structs, attempting to use ‘Add’ on the struct array will fail every time. It works _once_ (index = 0), but subsequently never works again. I tested this by logging the actor being added to the array, then logging the contents of the array before and after the add operation - as you can see, nothing is being added to the array:

```
LogBlueprintUserMessages: [BP_GripSensor_C_103] BP_GripSensor103 overlapped Cube26
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BEFORE ADD:
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] AFTER ADD:
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
LogBlueprintUserMessages: [BP_GripSensor_C_104] BP_GripSensor104 overlapped Cube26
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BEFORE ADD:
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] AFTER ADD:
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
LogBlueprintUserMessages: [BP_GripSensor_C_105] BP_GripSensor105 overlapped Cube26
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BEFORE ADD:
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] AFTER ADD:
LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110

```

Edit: I have tried duplicating the array into a temporary one, then assigning it back to the struct, this also does not work. Whilst the temporary array does receive a new entry, when setting the struct member array, it once again only has the first index and loses the new one.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_95d7a608](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_95d7a608](https://forums.unrealengine.com/u/anonymous_user_95d7a608)\
**Post date:** [October 31, 2016, 3:41pm UTC](https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617/2 "2016-10-31T15:41:59Z")

</div>

I just stumbled upon the same problem, but in blueprints, version 4.13.2.

You can not add more than one element to the arrays in the structs, tried Add, Append and Insert.

---

<div class="post-metadata">

**Author:** ![Holybreath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Holybreath](https://forums.unrealengine.com/u/Holybreath)\
**Post date:** [October 31, 2016, 4:02pm UTC](https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617/3 "2016-10-31T16:02:02Z")

</div>

Something to do with the pointer stuff… I usually just create a new array with all elements and replace the whole thing.

---

<div class="post-metadata">

**Author:** ![ambershee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ambershee](https://forums.unrealengine.com/u/ambershee)\
**Post date:** [October 31, 2016, 4:03pm UTC](https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617/4 "2016-10-31T16:03:25Z")

</div>

Don’t do that, it’s massively inefficient.

Just don’t use structs; create an object blueprint instead. It’s also painfully less than ideal, but it is at least reliable,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_95d7a608](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_95d7a608](https://forums.unrealengine.com/u/anonymous_user_95d7a608)\
**Post date:** [October 31, 2016, 8:14pm UTC](https://forums.unrealengine.com/t/bug-array-members-in-arrays-of-structs-just-plain-dont-work/368617/5 "2016-10-31T20:14:46Z")

</div>

I solved it with the object blueprint for now, thanks for the help Holybreath and ambershee.
