GUI.TextLabel don't work when click key

Hi.
I’m creating simple GUI (for main menu) and I have problem with TextLabel. All work fine, but when I’m click some key in TextLabel I get error:

My Main Menu.js looks that:

var mySkin : GUISkin;
var backgroundIMG : Texture2D;
var logoIMG : Texture2D;
var userName : String = "";

function OnGUI () {
	GUI.skin = mySkin;
	// TŁO
	var backgroundStyle : GUIStyle = new GUIStyle();
	backgroundStyle.normal.background = backgroundIMG;
	GUI.Label ( Rect( 0, 0, Screen.width , Screen.height), "", backgroundStyle);
	// LOGO
	var logoStyle : GUIStyle = new GUIStyle();
	logoStyle.normal.background = logoIMG;
	GUI.Label ( Rect( Screen.width/2-250, 0, 500, 250), "", logoStyle);
	
	var windowRect : Rect = Rect (Screen.width/2-200, Screen.height/2-150, 400, 150);
	windowRect = GUI.Window (0, windowRect, WindowFunction, "Logowanie");
}

function WindowFunction (windowID : int) {
	GUI.Label (Rect (30, 40, 100, 30), "Login:");
	GUI.Label (Rect (30, 80, 100, 30), "Pass:");
	userName = GUI.TextField (Rect (130, 40, 100, 30), userName);
	
	GUI.DragWindow(Rect (0,0,10000,10000));
}

I just tested your script, and it works fine on my end. So im guessing it must be one of the inspector references; perhaps one of them is unassigned?

Pozdrowienia z kraju kaczych klonów :stuck_out_tongue:

I don’t know what you mean.
If it help you to help me you can look in my assets.

Alright, i checked, and its your GUISkin. It does not define a font for TextField.

In general when you are using your own GUISkin to replace the default one, you should make sure you skin defines all the necessary attributes for the elements you are using.

Thanks, It’s work.