Unity UI: I have an input field in which I can type. Unfortunately, when I hit any of the movement keys, such as the space bar, I move while I'm typing which is not the effect I want. Is there a way to force the input field to consume the keyboard input so it doesn't also get picked up by the game? Or do I have to write the code in my game to do that for me. (Seems like it should be configurable at least).
-
\$\begingroup\$ I have the same issue. \$\endgroup\$ – Timothy Schoonover Mar 14 '15 at 2:10
\$\begingroup\$
\$\endgroup\$
Use a boolean variable to indicate at what point you should enter text and when not, then constrain the actions of his character in relation to the bool, ie:
public bool keyboradisactive;
if(keyboradisactive==false){
// actions of the character
}else{
}