I made an inventory for my game and I just tried to make it possible to move objects from one slot in an array to another by clicking on the slots. I tried to let the game put the coordinates of the first click on a slot in a global variable and then do the same with the second one. After the two clicks are done, the game sets two booleans to true (first one set = true, second one set = true). Then when these are true the game sets the value on the index of the second click to the value from the index of the the first click and then deletes the values from the first click. The array is 3 dimensional and one the X axis it stores the item ID, on the Y axis it stores the item count and on the Z axis it can store even more items (every index on the Z axis is the storage of another inventory or chest).
I can't find a way to get this working and also I think that there could be an easier way. Does anyone have an idea of doing that?