Hi,
When i press arrow keys or enter once i get a random number of input counts all at once from each key instead of just one. I pressed each key only once. Code is exactly as described in the video. See below for output:
void Update()
{
if (Input.GetKey(KeyCode.UpArrow))
{
min = guess;
guess = (max + min) / 2;
Debug.Log("Is it higher or lower than..." + guess);
}
else if (Input.GetKey(KeyCode.DownArrow))
{
max = guess;
guess = (max + min) / 2;
Debug.Log("Is it higher or lower than..." + guess);
}
else if (Input.GetKey(KeyCode.Return))
{
Debug.Log("I am a genius!");
}
}
Using visual studio 2019 & unity 2019