Reference Variable from seperate blueprint

I looked at other questions, and I think im simply overlooking something here. Following the Inventory UI with UMG tutorial, and in video 5 the author says its best to store the inventory on the character controller as opposed to the UI (which makes sense) but for the sake of simplicity and the tutorial, he just places the inventory on the UI instead. But I decided it would be a fun little project to figure out… Well, trial and error has not been kind. So, the basic setup is I have the First Person Controller BP that has an ‘Editable’ array called Inventory (made up of structs). I create 2 empty elements in it. Then in my UI script, I try to get a reference to the Inventory variable. I can get a reference to the First Person Character and save that as a variable, but for some reason I cant seem to pull the Inventory variable from it. Here is an image (this is within my UMG BP).

I know I’m probably making a noob mistake here, but I just cant seem to figure it out. Im too used to actual coding and not the visual approach. Also, is this even the correct way to do this. I can get a reference to the inventory here, but is it an actual reference or just a copy. Meaning, will any changes I make to this reflect back to the original BP script, or do I have to create another function that will save the changes back to the original.

Image of how its setup in the controller

Can you post a screenshot of how you have it set up in your character BP?

Added a picture

For starters, it doesn’t look like you are adding anything to the Inventory Array. Also, if you reference the specific inventory array, then you should be able to write to it.

Maybe I’m a bit confused, but the UMG looks like it is taking the controller BP inventory array and setting another (local to UMG) inventory array. Changing the local one will not change the referenced array.

Maybe it would be clearer if I knew what the two SET nodes were setting specifically.

I have a local variable on the UMG blueprint called Inventory as well (I know, my naming convention isnt the greatest). So im trying to grab the inventory from the player controller blueprint, and set it in the UMG bluesprint. The other set is setting another variable to the character reference itself (to get stats).

So now I’m further confused. I thought you wanted to change the character BP Inventory from the UMG BP

How do you know you’re not getting the Inventory from the Character BP? You still have to get an element from the array, or have you tried that and didn’t get anything? Have you tried to log the contents of the array?

That is my ultimate goal, but for now im just trying to figure out why I cant pull the inventory variable from the character controller to the UMG script. Once I get that figured out I can work on getting a reference or just updating the inventory manually.

I’m having the same issue. I’ve been using print string in between execution steps to see where the information is lost. Within the character BP, the array is created and has elements added correctly. It does appear that as soon as the script in the UMG blueprint begins, the array is empty. As SterlingY suggested, the UMG BP does seem to be making a local array unrelated to the character BP array. Any solutions would be appreciated.