GUI Array Help

Hi there!

I need some help with a pickup script I’m working on.

It’s pretty simple right now. I have another script where I pickup an item. This script is the inventory and It shows a text what you’ve picked up. I have it so the text stacks beside of each other, but the problem I have is that it stacks on the x position. I want it to stack on the y. So I want it to be in the left bottom corner (as it is), and the text stacking goes up and up.

I’m new to all this with arrays and stuff so don’t be to hard on me :wink:

var batteries = new Array();

function OnGUI()
{
	for(var i : int = 0; i < batteries.length; i++)
	{
		GUI.Label(new Rect((90 + (i*60)), Screen.height - 60, 120, 50), "Picked up Battery");
	}
}

If you want to change simply location of your GUI elements, you see a code below:

 function OnGUI() {
  for(var i : int = 0; i < batteries.length; i++) {
   //From left bottom corner
   GUI.Label(new Rect((0, Screen.height - 50*(i+1), 120, 50), "Picked up Battery");
  }
 }

I hope that it will help you