Because there’s no owner on the “create widget” node? Even if it’s not , it should have one or it’d get messed up with more than 1 player. Right click on the event graph and search for “get owning player” and plug it there, make sure that you set an owner when creating the widget aswell. Also, how does the inventory slot looks?
Are you sure the inventory struct isn’t null when the script is run? Make sure it isn’t , you can check that by printing the “isvalid” for the actor reference on the struct. If it’s null when you run the script the result will be what you have there and i’d be 90% sure this is the problem.
Also, i may be wrong, but i don’t think you should add a new widget for your items. The inventory should have several slots that when you pick an item it gets updated based on whatever method you decided to implement.
The way you are doing seems like every time you’d add a a new item it’ll wipe everything and re-add again plus a new item, even tough some items were already there. It may not do much difference on the final product, because a small inventory would be recreated really fast, but it’s an awfull programming method for several cases(i really can’t think one that it should be good, but i’m a new programmer so i’m probably wrong).
If you wan’t inventory pages i’d recommend you to create a master page widget that holds several inventory slots and when the amount of items in this page exceeds after adding a new item(or a bag, whatever you want) you create a new widget of the master page type and add to a widget switcher(or whatever fits your style better) that changes on a button click.
I’m pretty sure i left a lot of things to say but if you have any doubts Wes Bunn from epic games have 2 excellent tutorial series on inventory , 1 is drag and dropable and the other is not.
The one with drag and drop (there’s some bugs that he fixes on the last episode, so don’t worry about it when you see the first 2 ones ) :
The normal one :
Those 2 things helped me alot.