Hi guys,
So i’m having a problem: i am making an inventory system but in the AddItem void i need to see if the current slot has an item and if so if it is stackable and if so if it is equal to the item we are trying to add. So i made that, the only problem is i have no idea now how to set the string to the new one with the ammount of the item we are adding in it. Like imagine i got 10 wood logs in inventory. When i try to add another 10 logs i made it so it looks if theres any other logs in inventory so it can stack them. If so then i want it to set the text in the item child to 10 + 10 = 20. Here’s the code i got:
} else if (slots *.transform.FindChild (itemAdd.itemName).name == itemAdd.itemName) {*
-
this.transform.FindChild("Count").GetComponent<Text>().name( + ammount);*
// i want to do that in the (). Basically i want to add a number to the text. How do i make it?
-
}*