
And you need to change the state depending on what is supposed to happen next. Then you need if/else statements in the Update method. The first four paragraphs and the example are relevant for you, not the part as of “Enum advantages”.

Instead of “Importance”, you define “GameState” in your NumberWizard code. Also read the example and try to apply it in your game. If so, take a look at this article about enums. For this reason, you need a “game stopped” state, a “playing” and “starting” state, or whatever you need. An idea is not an implementation, though. For example, when the player pressed “enter” the first time, the game is supposed to stop according to your idea. What you need are game states based on which you define what is supposed to get executed in Update.

It means that the solution is not just one line of code. Your solution requires a bit more complex solution but if you are willing to learn something by reading, you’ll certainly be able to make your idea work. void Start()ĭebug.Log("Welcome to Number Wizard Fellow Friend and Traveler.") ĭebug.Log("Please Choose a Number Between " + min + " and " + max + "." + " But Don't Tell Me What it is!") ĭebug.Log("Is Your Number is Higher or Lower Than " + guess + "?") ĭebug.Log("Press Up if Your Number is Higher Than " + guess + ".") ĭebug.Log("Press Down If your Numbers is Lower Than " + guess + ".") ĭebug.Log("Press Enter When I Have Correctly Guessed Your Number.") ĭebug.Log("So, Your Number is Higher Than " + guess + ".") Įlse if (Input.GetKeyDown(Ke圜ode.DownArrow))ĭebug.Log("So, Your Number is Lower Than " + guess + ".") Įlse if (Input.GetKeyDown(Ke圜ode.Return))ĭebug.Log("So I Finally Got it! Your Number Was " + guess + "!") ĭebug.Log("Press Enter to Test My Skills Again.") ĭebug.Log("Is Your Number " + guess + "?") I’m wondering how I can make the script pause after 1 key input of Enter, and wait for a second one before taking any further action? This is what I have so far, if anyone has any ideas I’d appreciate any feedback, Thank you. I believe the issue is that after the player presses Enter the first time, the next frame occurs and it starts looking for any input again as the void update() function starts over. I can get the message to appear but the game just restarts without the need for an additional “Enter” input from the player.

Then a second press of Enter would initiate a new game. So after the player hits enter, confirming that the correct number has been guessed I would like a message to appear that says “Press Enter to Test My Skills Again!”.
