Hi.
I am looking for a solution on how to give focus to an InputField in the new UI system. I came across this:
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
EventSystem.current.SetSelectedGameObject(input.gameObject, null);
input.OnPointerClick(null);
}
}
The problem is that I get a NullReferenceException on line 6. Others have succesfully used this solution so I would appreciate any help as to why this is not working for me.