- Home /
What am I doing wrong? C#
 using UnityEngine;
 using System.Collections;
 
 public class MainGUI : MonoBehaviour {
     
     public GUITexture redKey;
     public GUITexture greenKey;
     public GUITexture pinkKey;
     public GUITexture yellowKey;
     public GUITexture purpleKey;
     public GUITexture orangeKey;
     
     public Vector2 redCoord;
     public Vector2 greenCoord;
     public Vector2 pinkCoord;
     public Vector2 yellowCoord;
     public Vector2 purpleCoord;
     public Vector2 orangeCoord;
     
     //other script with bool seing if you have a key
     public doors d; 
     
     
     // Use this for initialization
     void Start () {
         
         redKey.enabled = true;
         greenKey.enabled = false;
         pinkKey.enabled = false;
         yellowKey.enabled = false;
         purpleKey.enabled = false;
         orangeKey.enabled = false;
         
     
     }
     
     // Update is called once per frame
     void Update () {
     
         if (d.aredKey == true){
             redKey.enabled = true;    
         }
         
         if (d.agreenKey == true){
             greenKey.enabled = true;    
         }
         
         if (d.apinkKey == true){
             pinkKey.enabled = true;    
         }
         
         if (d.apinkKey == true){
             pinkKey.enabled = true;    
         }
         
         if (d.ayellowKey == true){
             yellowKey.enabled = true;    
         }
         
         if (d.apurpleKey == true){
             purpleKey.enabled = true;    
         }
         
         if (d.aorangeKey == true){
             orangeKey.enabled = true;    
         }
     
     }
     
 }
Im trying to get my GUITexture to display when I hit a key but nothing is happening
 using UnityEngine;
 using System.Collections;
 
 public class doors : $$anonymous$$onoBehaviour {
     
     public bool ared$$anonymous$$ey = false;    
 
 
 void OnTriggerEnter(Collider other) {
         if (other.gameObject.tag == "ered$$anonymous$$ey") {
             ared$$anonymous$$ey = true;
             Destroy(other.gameObject);
         }
         }
 }
Where are the agreenkey, apink$$anonymous$$ey, etc? And what do you mean by when you hit a key (Press keyboard, press a UI button, click on a gameobject etc)? 
"What am I doing wrong? C#" type questions are better addressed in forums since they are typically not useful for future readers in the Q&A format. When posting a question here you should be more specific so as to help future readers. Please also spend a little more time explaining your question in greater detail ins$$anonymous$$d of just pasting a large chunk of source code.
Answer by SubatomicHero · May 20, 2013 at 07:00 AM
Have you noticed the mis-spelling on the tag in your OnTriggerEnter() function in comparison to your other script at all?
Your answer
 
 
             Follow this Question
Related Questions
Erroe when resizing GUITextures in C# file 1 Answer
Toggle GuiTexture 1 Answer
What is frame, How OnGuI is called every frame? 2 Answers
UFPS:ultimate fps cameraGUI texture wont show in game 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
               
 
			 
                