Why sorting doesn't working?
This is a part of Drag and Drop inventory system.
Selected_Cell - value of the initial inventory slot.
Selected_Cell_type2 - the value of the final inventory slot.
Looks like you're trying to swap two items?
I don't think you need the for each XY element. My guess is that it is swapping multiple times because it is looping through each XY and performing the actions for each XY element.
Develop games in your browser. Powerful, performant & highly capable.
Prominent
Yes, thank you very much, removed the for each XY element, and now everything is working as it should