GUI Texture not responding to OnMouseEnter

I have a problem creating a simple pause menu in my game and this is my first time working with GUI. My problem is when I move over the text in the pause menu its not recognizing it, the text doesn’t turn red and the buttons don’t work. I am using two different scripts I have found on the web, combined and slightly modified them. Does it have anything to do with having to use the “Draw” function? Thanks for reading my question. On a side question for this script when I unpause the game using the Esc key the background music starts over, how do I fix that? Here is the script:

#pragma strict


var pause : boolean = false;
var resumeGUI : GUITexture;
private var allAudioSources : AudioSource[];
resumeGUI.enabled = false;

function Awake() 
{ 
	allAudioSources = FindObjectsOfType(AudioSource) as AudioSource[];
}

 function PauseAllAudio() 
{
 	for(var audioS : AudioSource in allAudioSources) { audioS.Pause(); }
}

function ResumeAllAudio() 
{
 	for(var audioS : AudioSource in allAudioSources) { audioS.Play(); }
}


function Update()
{
	 if(Input.GetKeyUp(KeyCode.Escape)) 
	 {
		 if(pause==true)
			 {
			 pause = false;
			 }
		 else 
			 {
			 pause = true;
			 } 
		 if(pause == true) 
			 {
			 Time.timeScale = 0.0;
			 resumeGUI.enabled = true;
			 PauseAllAudio();
			 }
		 else 
			 {
			 Time.timeScale = 1.0;
			 resumeGUI.enabled = false;
			 ResumeAllAudio();
			 }
	 } 
}

var isMainMenu=false;


function OnMouseEnter()
{
	 	//change text color
	 	guiTexture.color = Color.red;
}

function OnMouseExit()
{

	 //change text color
	guiTexture.color = Color.white;
}

function OnMouseUp()
{
	 //is this quit
	 if (isMainMenu==true) 
	{
		//load main Menu
		 Application.LoadLevel("AliensMainMenu");
	}
	 else 
	{
 		 Time.timeScale = 1.0;
		 resumeGUI.enabled = false;
		 ResumeAllAudio();
	}
}

Can you post a screenshot? I am not sure how many gui element you have right now (i think there are 1 pause and 1 resume), and what gameObject you are attaching this script to? (empty, guiTexture, guiText or something else)

Answer to side question

Answered question in UnityAnswers : [Continueing music after un-pausing][1]

Edit (3rd Rev)

In Unity’s documentation on [OnMouseOver][2], your overwritten version of OnMouseOver() is called every time your mouse is over the GUIElement or Collider this script is attached to. However, in your case, you attach it to the camera (which is neither GUIElement or Collider).

In your question, you said that you combined and modify 2 scripts, so I am quite sure that all the OnMouse function are from 1 script. What you should do now is to make it 2 script again ( I throw in a few lines to allow communication between 2 scripts ).

Proposed Solution

Pause Script (Attach to camera or empty object)

#pragma strict
  
var pause : boolean = false;
var clickTexture : ClickTexture[];
private var allAudioSources : AudioSource[];
 
function Awake() 
{ 
    EnableClick( false );
    
    for( var i : int = 0; i < clickTexture.Length; ++i ) 
      clickTexture*.pauseScript = this;*

allAudioSources = FindObjectsOfType(AudioSource) as AudioSource[];
}

function PauseAllAudio()
{
for(var audioS : AudioSource in allAudioSources) { audioS.Pause(); }
}

function ResumeAllAudio()
{
//ResumeAllAudio is not fixed
for(var audioS : AudioSource in allAudioSources) { audioS.Play(); }
}

function Update()
{
if(Input.GetKeyUp(KeyCode.Escape))
{
//Super lazy one-liner
pause = !pause;

if(pause == true)
{
Time.timeScale = 0.0;
EnableClick( true );
PauseAllAudio();
}
else
{
Time.timeScale = 1.0;
EnableClick( false );
ResumeAllAudio();
}
}
}

function RunOption( str : String ) {
if( str == “quit” ) {
Application.LoadLevel(“AliensMainMenu”);
}
else if( str == “resume” ) {
Time.timeScale = 1.0;
EnableClick( false );
ResumeAllAudio();
}
}

function EnableClick( b : boolean ) {
for( var i : int = 0; i < clickTexture.Length; ++i )
clickTexture*.Show(b);*
}
ClickTexture Script (Attach to GUITextre/GUIText)
-------------------------
var pauseScript : Pause;
var optionString : String;

function OnMouseEnter()
{
//change text color
guiTexture.color = Color.red;
}

function OnMouseExit()
{

//change text color
guiTexture.color = Color.white;
}

function OnMouseUp()
{
pauseScript.RunOption( optionString );
}
function Show( b : boolean ) {
this.enabled = b;

if( guiTexture ) {
* guiTexture.enabled = b;*
}

if( guiText ) {
* guiText.enabled = b;*
}
}
_[1]: http://answers.unity3d.com/questions/27542/continueing-music-after-un-pausing.html*_
_
[2]: http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnMouseOver.html*_