When main character(A) close to the npc(B), press the space key will dialogue with B.
Play in Unity3.3 is work goes will.
But when I run in exe, press the space key isn’t response, need press many times will have response.
As below is my code:
var dialog1 : boolean = false ;
var npc:GUISkin;
function Update() { }
function OnTriggerStay (myPlayer :Collider) {
if(Input.GetKeyUp("space")){
dialog1=true ;
}
}
function OnTriggerExit (myPlayer : Collider) {
dialog1=false;
}
function OnGUI(){
GUI.skin = npc;
if(dialog1 == true){
GUI.Box(Rect(5,Screen.height-Screen.height/4, Screen.width-10,Screen.height/4),"npc : 「・・・・・・」");
}
}
What’s my problem?
Thanks a lot!