Hi,
For some reason that i cannot fathom for myself, or fix by searching, the below code does not seem to be getting an array from the 4 in the list.
The text in the GUI Label works fine and i get no errors in the console when i play it, but after the line "Edison Utd Vs. " then it is just blank, and doesnt appear to be choosing a random name.
If anyone could explain this to me, without telling me to seach google then i would be very grateful.
Everything i have found on google is alot more complex than this and doesnt really give me the answer i am looking for.
Many Thanks in advance.
#pragma strict
public var NameArray : String[] = ["Rugeley","Lichfield","Cannock","Stafford"];
var chosenName : String;
function ChooseName()
{
chosenName = NameArray[Random.Range(1,NameArray.length)];
}
function OnGUI()
{
GUI.Label (Rect (10, 30, 100, 100),"Edison Utd
Vs
" + chosenName);
}