Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Is there something wrong with my c# script?

$
0
0
I Can't seem to figure out what the issue is here. Once i play the game, I go to my trigger collider, the GUI message appears, but when I click 'E', I get a "key not mapped" error. I tried swapping "E" for "KeyCode.E". But then I just don't get anything once I click "E". using UnityEngine; using System.Collections; public class Scene_Prctice : MonoBehaviour { public bool showGUI = false ; //transition to next scene/button show/button press // // // // void OnTriggerEnter (Collider other) //char enters collision trigger { if(other.CompareTag("Player")) //if char tag is "player" { showGUI = true; } if (Input.GetKeyDown(KeyCode.E)) //= "Press 'E' To Enter"; { Application.LoadLevel("noWhere"); } } public void OnTriggerExit (Collider other) //char enters collision trigger { if(other.CompareTag("Player")) //if char tag is "player" { showGUI = false; } } //Application.LoadLevel ("noWhere"); //Loads the level public void OnGUI() { if(showGUI) { GUI.Box (new Rect(400,200,200,20), "Press 'E' To Continue"); } } // // // // // // }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>