Unable to set array element in structure

I remember something about references from structures being an issue in my code, but I might be remembering wrong. It appears you don’t have a reference returned for the Category STR return value. I’m not saying you can make it a reference, but is there a way to expand the code for RTN Fetch Category from Category directly and somehow operate on a reference just to see if references are an issue.

I honestly don’t know what you are experiencing in regards to how you check if the array is set, but this is just a thought I had cuz it seems like you are directly accessing a reference when getting the container of the category, but not on the category fetching return value.

Maybe structure return values are references. Anyways, this is what I would check.

Working with struct arrays is a royal pain in the neck, you’d generally want to approach it like so:

Do note the panel on the left, this exposes struct elements. Anything left alone will remain unmodified.


Regarding your pic:

Notice the shape of the pin of the breaking CategorySTR - it’s round by value - it’s a copy of the original data. And it does not even matter than you later on correctly Get diamond by reference - you’ve been working on the copy of the data all along. So you end up pushing that data into a copy of the array. You read the original array and no changes can be found.

Working on arrays of nested struct arrays is even more fun. Especially when you go deeper. :expressionless:

1 Like

I am creating an inventory system similar to BOTW. It is divided into categories and each category has multiple containers and each container has multiple slots, In the image below this is the line of blueprints I am using to set the values on a slot. I get the category (A struct containing an array of containers) and then I get the container I want by breaking that and getting the right container at the index I supply. Then again I break the container to access the slots array where I attempt to set the array element from the slots array. This doesnt seem to be working and I cant figure it out :frowning:

Am I doing this right? I have tried doing what you said but it still isn’t working