Need Help with Crafting System

I’m making a crafting system for my game. The recipes are created in my CraftingSystem component, stored in an array, and then sent over to a widget in the form of a grid (similar to an inventory ). The problem I’m having though, is that when I create my recipe widgets, only the first recipe icon shows up on the screen, and the rest of them are just blank slots.

Here’s the blueprint inside my main widget that creates the grid.

Here’s the blueprint for my slots that sets the icon to the recipe icon

Here’s what it looks like when I try to run it. I have 3 recipes set in the array

As you can see, it shows the first recipe fine, but the 2nd and third slot are just blank slots like the rest of them.

I don’t expect anyone to know perfectly, but any pointers or ideas would be appreciated because I’m kinda stumped.

I suspect the RecipeInfo struct is not getting set properly. I mean, how does it know which Brush it should have before the object it lives in has been constructed? Seems like it would always be the default image unless you at some point assigned it to be something else.

Inside my crafting component, in the class defaults I created 3 recipes. The first one always works, its just the rest of them that don’t so I don’t think it could be that.

This is how I set up basically the same functionality you’re going for, the only differences being this is a text list without images and is only the single column. just switch out the name for a texture 2d and you should be all good.

Edit: I just realised you’re not casting to your grid slot class after creating the slot widget, i’m reasonably sure what’s happening here is you’re trying to tell your slot widget to decide its position, which it can’t do, you need to get the reference to the grid itself and set the slot widget as the content.

So in summary, you should be able to keep everything you have as-is, but with the addition of a cast to your grid panel class (see below for example).

If that doesn’t work just do it like I have below.