- Home /
How to include an input field in a text object?
The Unity Documentation for "Input Field" says:
"The Input Field script can be added to any existing Text control object from the menu (Component > UI > Input Field). Having done this, you should also drag the object to the Input Field’s Text property to enable editing.
The Text property of the Text control itself will change as the user types and the value can be retrieved from a script after editing. "
I created a Text UI Object, created an Input Field UI Object, and am attempting to drag the Input Field object into the Text field of the Text object, but it does not let me do that. Anyone know what went wrong?
Answer by DoTA_KAMIKADzE · May 22, 2015 at 01:40 AM
No no no, you drag&drop Text component to "Text component" field in InputField component, or select it directly from "Text component" field in InputField component. I'll update my answer with screens representing both scenarios in a while.
Update. Here are the screens:
1) Drag&drop:
2) Direct selection:
3) Also just FYI - you can do this via code as well.
P.S. Ah just noticed that you say you use 2 different objects, well you can do the same with different objects as well, just drag&drop Text object to "Text component" field in InputField component, or select it directly, or via code.
Your answer
![](https://koobas.hobune.stream/wayback/20220613200136im_/https://answers.unity.com/themes/thub/images/avi.jpg)