In my project I have a canvas and now I want to spawn a TMP_InputField
on it using script. For other things like Image
, TMP_Text
, etc. I simply generated a new GameObject
and added the necessary components to it:
GameObject object = new GameObject("Object", typeof(Image));
object.transform.SetParent(this.transform);
But for TMP_InputField
this doesn't work as expected. I can add the components to it and have an GameObject in my hierarchy but I don't know if I'm missing any components and how to link the ones I have up. Please help me. I can provide my code if requested although a clean and new solution would be more helpful.