Ok so the way i’ve set this loot system up is whenever a new item enters the inventory a button is created, and when it is
clicked the item is removed.
The problem is they are stacking on top of each other. I would like them to stack next to each other.
InventoryGUI.js:
function OnGUI () {
GUI.Box( Rect(280, 0, 200, 320), backDrop);
GUI.Box( Rect(280, 300, 200, 20), copperTexture + totalCopper + "c");
for (var i : Transform in UpdatedList) {
var item = i.GetComponent(Item);
if (GUI.Button( Rect(280, 0, 50, 50), item.inventoryIcon)) {
associatedInventory.RemoveItem(i);
item.Drop();
lastUpdate = 0.0;
}
}
}