Array inside of structure doesnt want to change.

Hi I’m trying to make a chest. Inside of player controler blueprint I have array of structures.

And this is my item structure.

I have chest blueprint with number. My HUD will take the number from chest blueprint and than will take element from chest array in my controler depending on chest number.

I wanted to change single element of item structure array from chest structure array like this.
Not Working.JPG
But it doesnt change anything. The array is the same as it was before.

I’ve made some test and I came up with this.


Its working, but it takes up a lot of space and time and if I want to change only 1 element I have to do this.

cf974bafc4732a132065c29ca411d3d21d8db5d6.jpeg
And if I have 20 items in array and I have to make something like this 20 times in different blueprints not talking about changing or expanding it later? RIP I’m too lazy for that.

Is there any way to change only 1 element of items array without all this mess?

Sory for my english :slight_smile:

When you Get a struct from the array, you get a copy, not a reference as you’d expect.

Have a look here for a solution.

SetMemberInStruct should solve your issue.

Hi, Dark Energy
Read this

This is working (tmp_array - local variable to store reference of array you want to update)
http://clip2net.com/s/3GxnJH1

Thx it works.