So, As the title says, I’m trying to add items to a basic inventory. I’ve barely been learning for a week and feel I’ve been picking it up rather quickly. But now I’m stumped. I’ve got a perfectly working system to add an item to the inventory, the blueprint even says it’ll add one item according to the item ID. But when I then pick up the item and check the inventory in the test area it says I’ve picked up a 10 of the items rather than 1. But nowhere in the blueprint is the number 10 written. I’m so confused. So I guess my question is… Where have I gone wrong?
Hello!
You can try adding a few “Print String” nodes to help you debug what’s going on.
To get started, I’d add one print node at the beginning of the “AddToInventory” function to print what’s the Quantity value this function is being called with, and I’d also add another print node connected to the “Loop Body” pin.
Then, when picking up an item, you’d expect to get the first print to display a number “1”, and the second print to trigger only once. Maybe you get the second print node showing 10 prints, which would indicate that the loop is running more times than expected.
Let me know the results and we can continue to debug further.
Unfortunately this hasn’t worked. All it did was print a few 1’s and make the inventory red that I have 8 of the item rather than 10
I found my problem. Thank you for the suggestion and the help but it was a small dumb mistake I made accidentally making the test item have a value of 10 rather than 1