Hey everyone.
So I have hit rock bottom trying to figure out what is going wrong with my blueprint. I have this fairly dynamic inventory/crafting system going on, which I’m following from a tutorial (Create a Crafting & Inventory system in Unreal Engine 4 Pt 7 Populate Crafting Recipie Lists & Data - YouTube). Problem is, (I’m guessing partly since the tutorial is 6 years old…) I’ve hit a bunch of array errors. I’ve managed to fix a lot of them along the way, but the one that still persists is when I drop or interact (eat) an item and removes it from my array again I get array and access none errors.
The funny thing is that I can drop one item - lets say a sword, or a box - once for each without the error triggering. But if i drop lets say 2 boxes the error will trig.
If anyone has the time to go over the screenshots I’ve linked, I would be so happy.
The error I’m getting:
Blueprint Runtime Error: “Attempted to access index 0 from array Inventory of length 0!”. Blueprint: W_InvMain Function: Item Name Text Getter Graph: ItemNameTextGetter Node: Return Node
Blueprint Runtime Error: “Accessed None reading structure ItemName_2_059D7BF849656A406DC94293281AFA91”. Blueprint: W_InvMain Function: Item Name Text Getter Graph: ItemNameTextGetter Node: Return Node
Blueprint Runtime Error: “Attempted to access index 0 from array Inventory of length 0!”. Blueprint: W_InvMain Function: Item Weight Getter Graph: ItemWeightGetter Node: Set ItemWeightTemp
Blueprint Runtime Error: “Accessed None reading structure Weight_5_C47948BE4533BB1E88B226969399C5B8”. Blueprint: W_InvMain Function: Item Weight Getter Graph: ItemWeightGetter Node: Set ItemWeightTemp
Blueprint Runtime Error: “Attempted to access index 0 from array Inventory of length 0!”. Blueprint: W_InvMain Function: Item Details Getter Graph: ItemDetailsGetter Node: Return Node
Screenshots:
The main function screen: https://i.imgur.com/ZAKxZgv.png
The add item/stack loop: https://i.imgur.com/6j33rHw.png
The drop logic: https://i.imgur.com/yIrlRtI.png
The automated details system that pops up along with the selected item (there is one for item name and weight as well): https://i.imgur.com/hOl02vQ.png