Can not type in InputField

Hi there…In my InputField,I can’t type anything.I want to type answer in numbers but I can’t.It works fine in other levels but in level 5, it doesn’t work.I didn’t change anything in Inspector.Here is my script,
public InputField mainInputField;
public float Answer = 5f;

public GameObject WinUi;
public GameObject WrongUi;
public Text timeText;
public GameObject Timercanva;
public GameObject CanvaMain;


public void QAComplete()
{
    WinUi.SetActive(true);
}
public void GameOver()
{
    WrongUi.SetActive(true);
}
public void InputText()
{
    if (mainInputField.text == ""+ Answer )

    {
        FindObjectOfType<num2q21>().QAComplete();
        Timercanva.SetActive(false);
        CanvaMain.SetActive(false);

    }

    else
    {
        FindObjectOfType<num2q21> ().GameOver();
        Timercanva.SetActive(false);
        CanvaMain.SetActive(false);

    }
}

public void Replay()
{
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}

public void NextLevel()
{
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);

}
public void ToMenu()
{
    SceneManager.LoadScene(sceneBuildIndex: 0);

}

}
Same script used in other levels.Please help!This level is a duplicate of level 4,but InputField didn’t works So I putted a new

1 Answer

1

being able to type is unrelated to whatever you put in the script, try creating a new inputfield UI again, also

         FindObjectOfType<num2q21> ().GameOver();

there should be no spaces between > and (

I fixed but not works:(

I added a new canvas and that worked!.