- Home /
key binding
https://www.youtube.com/watch?v=MEHe0Uf3m4I
this is the video I watched and he explained it well but is not working on the 2017.2.0f3 version i think it uses old methods i have written this and it dose not work (if you don't want to watch the video)
void OnGUI()
{
if (CurrentKey != null)
{
Event e = Event.current;
if (e.isKey)
{
Keys[CurrentKey.name] = e.keyCode;
CurrentKey.transform.GetChild(0).GetComponent<Text>().text = e.keyCode.ToString();
CurrentKey = null;
}
}
}
Comment
Your answer
Follow this Question
Related Questions
KeyCodes for non-US keyboard layouts 3 Answers
KeyCode and ? (question mark keyboard) 1 Answer
If, GetKeyDown, and Update() not working 2 Answers
Method name expected when adding Event Trigger using script 1 Answer
Assign keystrokes to GUI button 2 Answers