Question by
alanmeana · Oct 02, 2016 at 05:40 AM ·
textinputfield
how do I get the text form Inputfield
I want to get the text from InputField and store it,
I've tried this :
InputField = folder name;
void start(){ foldername = foldername.GetComponent InputField>();
My question is how do I get that text, do I have to store it in a string var?
Comment
Answer by Fornoreason1000 · Oct 02, 2016 at 07:09 AM
the easiest way is like this.
string myText = GetComponent<InputField().text;
be sure to look through this too: https://docs.unity3d.com/ScriptReference/UI.InputField.html
Hope it helps