Script Problem...

Hello, I am having a problem with a script. I am making an object enable and disable. But, no matter what I do, the object always appears. :face_with_spiral_eyes: Here’s the script I am using:

var TL : TL1;

  function Start () {
     TL.enabled = false;
       }

 function Update () {
       if (Input.GetKeyDown (KeyCode.DownArrow)) {
           TL.enabled = true;

          }
       if (Input.GetKeyUp (KeyCode.DownArrow)) {
          TL.enabled = false;
          }
}

Thanks

I’m not entirely positive if enabled will hide the GameObject; I think it just prevents its various events (Update, OnMouseUp, etc.) from firing. Instead try adding:

TL.gameObject.renderer.enabled = true/false;

Thanks. That worked! :smile: