2D Array with struct - empty array inside the struct

Hello,
I have an array with structs which also contains an array and an integer value. So a 2D-Array.
The structs are complete but if I start to add stuff in the struct array, they are empty on the end.

This is how I populate the array:

(In this example the “Target LayerIndex” is always fitting with the array index)
Using 4.6.1

Hey

I had the same problem today, and it was driving me nuts. Eventually I guessed that while I was adding objects into my deeper arrays, the struct itself was not being updated in my array of structs. I got around it by making a new struct using the old structs data (except with an added item in the deeper array), and then using the Set Array Element node on the struct array to overwrite the existing struct with the new one. This seems to work for me, although I’m testing it a little more.

So, in your case, after you have done your Add, make a new Layer using the old Blocks (which has an added Block) and Layer Index, then use Set Array Element on your Level Layers with the new struct and old index. I really hope that works for you!

Edit: Haha, after some more testing, it turns out I still have this problem. I can’t seem to make a new array from the old array and the new item and use that in the new struct, not with add or append.

Edit2: And solved it! I needed a function to do the adding to the deeper array, returning the longer array as an output.Then I could make a new struct using this new array. The problem before was that while I was adding a new item onto the array, when I made my new struct, UE decided to use the old ‘non-added’ array, since the pin connected to the array which had been evaluated before the add. With the new function, the pin can caonnect to an array that has been evaluated after the add.

Yep, nothing in the struct get updates. For now I make a temporary array outside and set this in the struct. Even removed items aren’t updated in the structs. (as well it returns true from the remove node)

Maybe a bug?

I don’t realy like all this workarounds. So, plan B: All in one big array. For my needs it shouldn’t be a big problem or to much performance cost.

I experience te same problems with Version 4.12.5. Can’t seem to do anything with arrays inside structs.