Howcome the keyboard doesn't open? (using script from docs)

Hi,

I grabbed this from the scrip reference page, but it won’t open my keyboard?

the debug messages told me it was open.

var inputURL : String = "http://www.unity3d.com";
private var keyboard : TouchScreenKeyboard;



function OnGUI() {
    if (GUI.Button(Rect(0, 10, 200, 32), inputURL))
	    keyboard = TouchScreenKeyboard.Open(inputURL, TouchScreenKeyboardType.Default);

	if (keyboard)
	Debug.Log ("keyboard_IsOpen");
		inputURL = keyboard.text;
		}

cheers, Tim.

Fixed: Just used a different method.

GUI.TextArea (Rect (10, 10, 200, 100), pname, 200);

and it assumed I wanted the keyboard when I pressed it.
(Doesnt work in UnityRemote)

Now to figure how to save the users text to playerpref :slight_smile:

EDIT: if anyone wants, heres how to save keyboard input to a playerpref.

var pname : String = "";
var customskin : GUISkin;

function Awake () {
    pname = PlayerPrefs.GetString ("pname");
}



function OnGUI(){

GUI.skin = customskin;


pname = GUI.TextArea (Rect (10, 10, 200, 75), pname, 15);
var keyboard = TouchScreenKeyboard.Open(pname, TouchScreenKeyboardType.Default);

 if (keyboard.active) 
       pname = keyboard.text;
 PlayerPrefs.SetString("pname",pname);

}