Return key not working

Hello! I’m very excited to be taking the course, but for some reason my code just doesn’t seem to work. Or, more specifically, my return key only works once. Past the first game (after the first time the game runs) it will cease to respond to being clicked. I’ve seen the other issue posted, and made sure that my key doesn’t respond.

using UnityEngine;
using System.Collections;

public class NumberWizards : MonoBehaviour {

// Use this for initialization
int max;
int min;
int guess;

void Start () {
	StartGame();	
}
	
void StartGame () {
	max = 1000;
	min = 1;
	guess = 500;
	
	max = max + 1;
	
	print ("========================");
	print ("Welcome to Number Wizard");
	print ("Pick a number in your head, but don't tell me!");
	print ("The highest number you can pick is "  + max);
	print ("The lowest number you can pick is " + min);
	print ("Is the number higher or lower than " + guess + "?");
	print ("Use up arrow for higher, down arrow for lower, and return key for equal.");
}
	
// Update is called once per frame
void Update () {
	if (Input.GetKeyDown(KeyCode.UpArrow)) {
		//print("Up arrow pressed.");
		min = guess;
		NextGuess ();
	} else if (Input.GetKeyDown(KeyCode.DownArrow)) {
		//print("Down arrow pressed.");
		max = guess;
		NextGuess();
	} else if (Input.GetKeyDown(KeyCode.Return)) {
		print("I won!");
		StartGame();
	}
}	
void NextGuess () {
	guess = (max + min) / 2;
	print ("Higher or lower than " + guess + "?");	
}

}

(I’ve never used forums for coding, so I just straight copied and pasted my code. I’ll be happy to learn how to send my code correctly in the future)

Privacy & Terms