- Home /
On end edit inputfield script
I wrote this script and added it to the input field as on end edit, and it didn't work. I could see the debug message when I had GetText.ReadStringInput selected. I think I need to change the setting of this but I don't know what could make it work.
private string input; public GameObject cube; float m_distanceTraveled = 0f; public void ReadStringInput(string s) { input = s; Debug.Log(input); void Update() { if (input == "go north") { Vector3 oldPosition = cube.transform.position; cube.transform.Translate(0, 0, 50 * 1 * Time.deltaTime); m_distanceTraveled += Vector3.Distance(oldPosition, cube.transform.position); } }
Follow this Question
Related Questions
UI 4.6 input field how do I use the .onendedit? 1 Answer
InputField.ActivateInputField() giving NullReferenceException error 1 Answer
Is there a notepad-like (preferably a notepad++-like) in-game text editor for use in Unity5? 0 Answers
can't change InputField text using textComponent 1 Answer
Changing something in another scene by answering correctly with GlobalManager 0 Answers