No response from key presses

Hello,
I’m not getting any errors from my code but also no response at all from up/down arrow keys presses.

	// Use this for initialization
	void Start () {
        print("Welcome to Number Wizard");
        print("Pick a number in your head but don't tell me");

        int max = 1000; 
        int min = 1;

        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 500?");
        print ("Up arrow for higher, down arrow for lower, return for equals");
    }

	
	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown(KeyCode.UpArrow)) { 
                print("Up arrow pressed");
          }
     
        if (Input.GetKeyDown(KeyCode.DownArrow))  { 
                print("Down arrow pressed");
        }         
	}
}

Solved

I got this to work.

Was your script added to a GameObject Jason?

Exactly, it was NOT.

Thanks Rob!

1 Like

Thanks for clarifying, may be useful for other students too :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms