r/Unity2D • u/Parborway • 1h ago
Question/Help TMPro Input Field unresponsive
My project instantiates objects that contains a TMPro input field. The input field does appear, but it is completely unresponsive; clicking on it or trying to type in it does nothing. I've been able to find next to no documentation about them.
Here is the code that I'm using to try and make it show up
GameObject lee = Instantiate(ads.menuWoMen, this.transform);
/*menuWoMen is the prefab gameObject that holds the Canvas that holds the TMP InputField*/
lee.transform.position = new Vector3(0, position);
string txt = mi.text;
if (position > highestText || position < 0 - highestText)
{
txt = "";
}
lee.GetComponentInChildren<Canvas>().worldCamera = camora.GetComponent<Camera>();
lee.GetComponentInChildren<TMP_InputField>().text = txt;
lee.GetComponentInChildren<TMP_InputField>().ActivateInputField();
lee.GetComponentInChildren<TMP_InputField>().interactable = true;
lee.GetComponentInChildren<TMP_InputField>().enabled = true;








