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
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.
answered Sep 28 '16 at 03:45 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here