- Home /
The question is answered, right answer was accepted
What determines the initial active InputField
I have multiple InputFields, as you may have guessed. When I hit play, what is telling the InputField to activate? My issue is simple, I would like the first InputField in the line of fields to be the active 1 but it defaults to the second 1 down. I haven't added any code to initialize it and I don't see anything in the inspector for setting the default. I would prefer not do it through code if possible but, if not possible I just need a simple "You can't do that".
Is it something to do with this? https://docs.unity3d.com/2020.1/Documentation/Manual/script-SelectableNavigation.html
Answer by tdx110 · Mar 22, 2021 at 10:27 PM
unity_ek98vnTRplGj8Q he is right.
I'm sorry I got it wrong. My English is not good, and the translator translated it strangely. Like this:
[SerializeField]
private InputField inputField;
void Start()
{
inputField.Select();
}
Apparently in the EventSystem object that gets created when adding a Canvas there is an EventSystem Script that sets the initial Input.
Answer by tdx110 · Mar 19, 2021 at 11:38 PM
I'm sorry, but if you want to make a dependency, it has to be written in the code. Unless you are using blueprint.
Follow this Question
Related Questions
Unity 4.6 InputFields need help 1 Answer
Draw your own InputField, cursor/selection location 2 Answers
Unity 5 input field unable to store user input 1 Answer
How to validate the characters of the strings to the characters typing via mobile keyboard? 0 Answers
UI ScrollRect mask not hiding Input Field Caret and Highlight 1 Answer