- Home /
Best Answer
Answer by Sergio7888 · Oct 08, 2016 at 07:22 PM
Use Input.GetKeyDown:
if(Input.GetKeyDown(KeyCode.Alpha1)||Input.GetKeyDown(KeyCode.Keypad1)){
//start game code
}
if(Input.GetKeyDown(KeyCode.Alpha2)||Input.GetKeyDown(KeyCode.Keypad2)){
//quit game code
}
I think
Input.GetKeyDown("1") should work too.
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
How to check if game has just been launched 2 Answers
Stop Watch start when told 2 Answers
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
When I click on 'play' by the main menu, level 1 won't start... How to fix that? 2 Answers