UI Widget does not load class in Create Widget node unless the class field is manually refreshed

I have an inventory widget. It has a uniform grid. When the player Event Begin Play then an array containing icons of items in the inventory is passed, one by one, in a for loop to the inventory widget which uses the Create Widget node to make an item in a slot on the grid using the supplied icon. If there is no item in that slot it will show an empty slot image.

Whenever I open UE5 editor and playtest the inventory will show only blank white boxes for every slot in the inventory.

To fix it I have to go into the inventory bp, find the Create Widget node responsible for creating the Child Widget of the Grid, switch the class to a random different one, and then switch it back to the correct class. After doing that the inventory loads correctly with all the right icons.

How do I fix this? I’ve tried creating a var on the inventory that has a default value of the correct Item Slot class (didn’t work.) I’ve also tried having the player character bp pass the Item Slot class to the Inventory Widget which then plugs it into the Create Widget node (also didn’t work.) I’m out of ideas!


This is how it looks when I first playtest the game after opening up UE5.

2
This is the Create Widget node which is supposed to use the class. It doesn’t work properly unless I change the class to a random one and then switch back to the correct one. I have to do this everytime I open UE5 from the desktop.


This is how it is supposed to look, and how it looks after switching out the class in the Create Widget node and then switching the correct class back in. After doing that manual step it loads correctly when playtesting until I reopen UE5 from the desktop again.