texture on collision display not working

I have a game object with a box collider trigger and inside that trigger I have this code

var map : Texture2D;

function Start () {

guiTexture.texture = map;
guiTexture.enabled = false;


}


function OnTriggerEnter (player : Collider) {
if(player.tag=="Player")
Debug.Log("in trigger area for text" );
guiTexture.enabled = true;

}
  1. I am declaring Map as a 2d texture
  2. Then I am saying guiTexture.texture = map (so the image I drag in the inspector now is a guiTexture
  3. Then I am enabling it as false so it is not seen
  4. Then in a fucntion I ams aying if player enters trigger then texture enabled is true

The debug log works so that picks up but I’m getting this error

MissingComponentException: There is no ‘GUITexture’ attached to the “Triggertext” game object, but a script is trying to access it.
You probably need to add a GUITexture to the game object “Triggertext”. Or your script needs to check if the component is attached before using it.
Text_trigger.Start () (at Assets/Scripts/Text_trigger.js:5)

So I also made a guitexture through game object > create other > guitexture which brings up a Unity watermark which I changed into the map image and then ticked it off, am I doing it right?

Am I also supposed to put a script into this guitexture?

Solved

Just one script on the collider

var map : GUITexture;

function Start(){

map.enabled = false;

}

function OnTriggerEnter (player : Collider) {
if(player.tag==“Player”)
map.enabled = true;
}

function OnTriggerExit (player : Collider) {
if(player.tag==“Player”)
map.enabled = false;
}