I’m making a click based project and I’m trying to add an item to an array with a UMG button click. I have watched many tutorials but the only ones I can find involve ray trace or overlap events. Because I don’t have a physical player in my project I haven’t figured out how to work around this. Here’s what I have so far.
Below is my content browser. S_ItemData is a struct with all the variables of what the item is. Right now it only has a Name value. I plan on adding much more variables once I have figured out how to get this to work. BP_Item_Master is a Data Only BP that has the S_ItemData Variable. BP_Metal is a child of BP_Item_Master with the S_ItemData info (Right now just the name) filled out.
Next we have the widget BP for my test. Basically it has two buttons thats gives the player two options, right now I have only done anything with the first option and have set it to always be metal. I do not get a failed to cast print string here but I am also unsure that it’s actually setting the ‘item selected’ to BP_Metal correctly.
And lastly is the ‘AddToInv’ function I have in my player controller(where my inventory struct is held). This is where I am getting the failed to cast printed to the screen.
I am completely lost on this and have been trying to work on it for about a week now with no luck. Any help or suggestions is much appreciated. Thanks.