so i am trying to make when player entering a collider/trigger it will show text telling them to press a key, and then when the key pressed (still inside the collider/trigger) the game will paused and an image will pop up.
there is no problem with the text but when i press the key the image doesn’t show at all
is there something wrong with my code? (i am us9ng first person controller prefab)
var textinfo: GUIText;
var popupimg: GUITexture;
function Start(){
popupimg.enabled = false;
}
function OnTriggerEnter() {
textinfo.text = " Press E for info";
if(Input.GetKey(KeyCode.E)){
Time.timeScale = 0;
Destroy(teksinfo);
popupimg.enabled = true;
}
}