How to get text from UI.InputField?

I want to get text from the user interface InputFieldbut I don't know how.

+4
source share
1 answer

You can do this by first getting a link to gameObject, then getting the component from it InputFieldand selecting a variable text:

    GameObject inputFieldGo = GameObject.Find("PathToTheGameObject");
    InputField inputFieldCo = inputFieldGo.GetComponent<InputField>();
    Debug.Log(inputFieldCo.text);
+19
source

All Articles