So, I was making a shop in which you could put multiple items and sell them one by one. I achieved that by making an array variable, adding object references into it and then removing the first object in array and the same object in game when the player activates the shop.
This works fine with single objects, but breaks when I put multiple objects into it, by “forgetting” each second object put inside, no matter the object amount. It still sells the object if i remove the other ones first though.
Here is the code:
Top screenshot is the code for adding/removing objects in the array, bottom is for removing the object when selling the item.
(Sorry for sticking screenshots together, can’t put more than one media file in here)
Am I doing something wrong? “Make Array” doesn’t seem work.