Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Wait a input in a Input field

Discussion in 'Immediate Mode GUI (IMGUI)' started by breeisdev, Jun 3, 2022.

  1. breeisdev

    breeisdev

    Joined:
    Apr 3, 2022
    Posts:
    1
    Hello. I’m trying to create a mobile app like a quiz.
    I would like the game to ask a question, wait for the player to enter his text and then ask a new question and so on.
    I put my function in On End Edit but it asks once an input and then asks the last questions .
    Here my code

    Code (CSharp):
    1. while (index != numberOfLine)
    2.         {
    3.             if(index % 2 == 0)
    4.             {
    5.                 questionText.text = "Cossi se ditz: " + words[index];
    6.             }
    7.  
    8.             index ++;
    9.  
    10.             if(reponse.text == words[index])
    11.             {
    12.                 Debug.Log("Blyat");
    13.             }
    14.  
    15.             Debug.Log(index);
    16.         }
    My questions and answers are in a list. The array of question is an even number and the answers an odd number