I tried making inventory system and when I want to drop an item all items that are the same type are also dropped.
Tried using for each loop with break but it didn’t help.
This is the blueprint I use for droping items.
If You know how to make it drop only one item instead of all items that are the same as the one I wanted to drop, I would really appreciate Your help.
Removing elements from an array while iterating through the said array can lead to some catastrophically unpredictable results. Instead, find the item you need (by storing the index where it was found, perhaps), exit the loop and only then remove the element from the array.
Try this first and see if that helps.
The assumption here is that the items do, indeed, differ.
edit: what you’re doing here with Break, should be OK, though. So perhaps it’s the elements themselves at fault here. As in, they do not contain the data you think they do.