The problem I am having is that I am unable to create the GUI.labels dynamically. Ths code below is running through the loop, there are items in playerInv.carrying and the code is in OnGUI too. So pretty much the labels aren’t being created. What is the problem and how can I over come this?
if (GUI.Button(Rect(425,5,100,100),"Show Inventory"))
{
print("Current inventory items:");
var invItems : int = 0;
for (item in playerInv.carrying)
{
print (item.name + " - Value: " + item.value + " Holding : " + item.quantity + " Net Value: " + item.netValue);
invItems ++;
var itemName = item.name;
GUI.Label(Rect(25, 110+(invItems*20), itemName.Length*8, 20), item.name);
GUI.Label(Rect(300,110,200,20),"wefiewjpiofewmp");
print("Label Created!");
}
}