- Home /
add button like escape or shift
how do i add new keys to unity?? like shift escape
becouse i want to use the esc button for when i press it my game willgo to a gui like Options gameplay Exit game thanks coud not find it on unity answers srry
Answer by Bunny83 · Feb 20, 2011 at 11:18 AM
You can assign new keys in the input manager and use the Input-class. Unity recommends to use this, but for special keys that should not be able to be changed by the user like "Escape" use:
if (Input.GetKeyDown(KeyCode.Escape)) { / Do something / }
I wanted to highlight my snippet as code but i can't mix links with code so i keep it that way.
Your answer
Follow this Question
Related Questions
Problems with joystick / controller axes being 1/-1 "way too often" 1 Answer
cannot read button input from oculus go (but able to read rotation) 0 Answers
Unity Input System Package Stick/Axis Deadzone if set as a processor not working 0 Answers
How do I use controller knob input like mouse position? (New Input System) 1 Answer