I am making a game where you can type stuff into a text box and then things will happen onscreen, such as a box will move. Im using a script which will see what you wrote and depending on what you wrote it does something, e.g., if you type "hello" it will say hello in the debug log. I tried to do something like this:
using UnityEngine;
using TMPro;
public class TextToAction : MonoBehaviour
{
public TextMeshPro Text;
void Update()
{
if(Text.text = "hello")
{
Debug.Log("hello");
}
}
}
but it wouldnt work. Any thoughts?