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.
1 Answer
1
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 
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);
}
I do believe that the TouchScreenKeyboard will only be visible on mobile devices that has a touchscreen. Are you testing on a device or in the editor?
– GameVortexHey, I'm testing in unity through unity remote, but also tried on a compiled app.
– ODNSEV7N