For Loop GUILayout.Label Problems

Note: Using Javascript

Hi, I’ve Tried Searching For Other People That Are Having This Same Problem And Couldn’t Find Anything, So I Decided To Post This Question To See If Anyone Could Help.

Code:

var StringArray : String[] = ["Hi", "Bye"];

function OnGUI()

{

      for(var i : int = 0; i < StringArray.length; i++)

       {
    //So I Could See If The For Loop Was Going Through And It Wasn't
           Debug.Log("i Value: "+i);
    
           GUILayout.Label(StringArray*);*

}

}
It Doesn’t Display The Label And Nothing Goes Through
Please Help, Thanks

Are you certain that your script is attached to an object in the scene?

If it is, try:

function OnGUI(){
    Debug.Log("OnGUI");

    //the rest of the function...
}

…so you can be sure that you’re getting OnGUI events.

If you are, the problem is in your loop (which looks OK to me).