- Home /
How do you create hotkeys in your game.
Hi, COuld someone please tell me how to make shortcuts in my game to do stuff. For example press "H" to make a dialog appear. How do you do this? Thanks in advance
Comment
Answer by Kirbyrawr · Jun 18, 2013 at 11:29 PM
GUI = false;
function Update(){
if (Input.GetKey (KeyCode.H))
GUI=true;
}
function OnGUI(){
if(GUI==true){
GUI.Box(Rect(Screen.width/2,Screen.height/2,Screen.width,Screen.height),"This is a dialog");
}
You have a lot of things here: http://docs.unity3d.com/Documentation/ScriptReference/
Your answer