Hello, I was following this tutorial to create an inventory system. I want to do a simple/basic crafting system, that check if the “item” is in array (inventory) and if so it will add and remove items.
The problem is, I cannot find a way to “find” the item. I tried something that is visible on the picture below but its not working. Did I do something wrong ? The “Item1” is of variable type item1 (from bp) and then → get item info.
So you want to find an item in the array?
You can use Contains, as you are, to check if that item is in there.
You can use Find to find the item, which returns its index.
You can use Get to get the item. Plug in the Find output (the index) into the Get index input.
Access these the same way you would get Contains, by right-clicking in the blueprint and going to the array dropdown or typing in “Contains,” “Find,” and/or “Get.”
im having the same problem. i can run a for each with a print and all items in the inventory print to screen, i can compare if the names of each are = to the required ingredients and return true and print only the names of the items needed for that recipe. i can build the new item and add it to my inventory. the only thing i cant figure out how to do is remove the needed items from the inventory when the new item is crafted. im thinking the find/contains are not working because there is a struct behind the array. I did try taking the node from the contains/find and making it that of the struct but when i plug in the name/class it doesn’t find anything