4.14.1 Array within structure Array result in nothing

I have this problem:

I have an array of a structure .
Within the structure I have a couple of arrays.
I’m trying to add an element to the array

The adding leads to nothing. This should be possible right ? Is this a bug ?

Just run into exactly same issue. It’s totally strange behavior since Add isn’t even returning a new array so it’s should be mutating original one. I tried various approaches like Set Array Item, Append an array with that new item or Insert. Nothing is able to touch that inner array. Perhaps it’s some weird limitation of a struct?

My workaround for now is that I add the element to a local array and set the array completely with the local array as input.

That is not a bug. Structures get passed by value, not reference. When you use the “Get element at index 0” node on a array of structures, it returns a copy. After you do whatever changes you want to do, use the “Set array element node” to set the new structure at index.

Ah thanks… so my current ‘workaround’ actually is the way to do it.Got it.

Yes thanks, I confirm it indeed works like that, but it’s totally awkward :slight_smile: Would be very useful if there was option to get reference of struct from array.

Btw, @ipas, be that kind and mark this as answer :wink:

I tried this as well. I still cannot get it to work. Could someone possibly post a screenshot of how they set up the working code?

Here is a sample on how to get this working. First the content of the strucure-array into local arrays. Second manipulate the arrays by adding or removing items. Third set the element of the array-structure. This is in fact replacing the element with all the arrays.

Hope this helps.