I am making a custom control setup dialogue and do now know how to
make it wait for the player to press the key they wish to assign.
The way it is set up is using built in GUI with labels for the
action and a button to press to change each one. I want the game
to halt and display “Press any Key” to take their input and assign
it to that action.
I have tried using:
while (!Input.GetKeyDown(KeyCode.Return)) yield;
in this fashion:
if(GUI.Button(new Rect(125,
50,
60,
30),
"Choose")) {
_displayKeyChoice = true;
}
// Display key choice
if(_displayKeyChoice) {
while (!Input.GetKeyDown(KeyCode.Return)) yield;
}
But, it returns a parser error and I am not sure why.
Is there a really good way to do this and do you have any suggestions please?