- Home /
problem whit input key
I can not use the keyboard input. This is a test script. It does not work.
function DisableGuiText () {
if(Input.GetKey(KeyCode.F10)){ GameObject.Find("Player").GetComponent("TextOnGui").enabled=false; }}
Comment
Answer by programmrzinc · Mar 02, 2012 at 01:06 PM
Did you call the DisableGuiText function in the script? I would use the Update Function instead
function Update () {
if(Input.GetKey(KeyCode.F10)){
GameObject.Find("Player").GetComponent("TextOnGui").enabled = false;
}
}
Your answer
Follow this Question
Related Questions
Key not recognized 2 Answers
Is it possible to change keyboard input inGame 1 Answer
No keyboard events detected after any key is held. 0 Answers
disable all inputs 1 Answer
Text Prompt Problem 1 Answer