3D gameObject menu with 3d Text, text not changing color

Sorry, I know the title is a bit vague. I have two scripts to make my 3d text change color on my menu system. The text is in a parent object called “MainRotation” and the objects are called “Play”, “Options” and “Quit”. All 3 texts have a box collider.
The parent object had the following script attached to it:

using UnityEngine;
using System.Collections;

public class Main : MonoBehaviour {
	
	public int number = 0;
	
	private GameObject play, options, quit;
	
	private void Start(){
		
		play = GameObject.Find ("/RotationMain/Play");
		options = GameObject.Find ("/RotationMain/Options");
		quit = GameObject.Find ("/RotationMain/Quit");
	}
	
	private void Update(){
		
		switch(number)
		{
		case 0:
			play.renderer.material.color = Color.white;
			options.renderer.material.color = Color.white;
			quit.renderer.material.color = Color.white;
			break;
		case 1:
			play.renderer.material.color = Color.blue;
			options.renderer.material.color = Color.white;
			quit.renderer.material.color = Color.white;
			break;
		case 2:
			play.renderer.material.color = Color.white;
			options.renderer.material.color = Color.blue;
			quit.renderer.material.color = Color.white;
			break;
		case 3:
			play.renderer.material.color = Color.white;
			options.renderer.material.color = Color.white;
			quit.renderer.material.color = Color.blue;
			break;
		}
		
		if(Input.GetButtonDown("Fire1") && number != 0)
		{
			switch (number){
			case 1:
				//play clicked
				break;
			case 2:
				//click load
				break;
			case 3:
				Application.Quit ();
				break;
			}
		}
		
	}
	
}

The texts each have the script:

using UnityEngine;
using System.Collections;

public class text : MonoBehaviour {
	
	
	public int id;
	
	private void OnMouseOver()
	{
		GameObject cam = GameObject.Find ("/Camera");
		Main menu = cam.gameObject.GetComponent<Main>();
		menu.number = id;
	}
	
	private void OnMouseExit()
	{
		GameObject cam = GameObject.Find ("/Camera");
		Main menu = cam.gameObject.GetComponent<Main>();
		menu.number = 0;
	}
}

I have changed in the editor each text to have IDs of 1, 2 and 3 for play options and quit. I’m getting the error “NullReferenceException: Object reference not set to an instance of an object
Main.Update () (at Assets/Scripts/Main.cs:22)”

Anyone can help me with this? The texts don’t change color at all.

The funky thing about 3D text is that, although it has a material, changing material’s color will not change the texts’ color.

You need to do things like these:

    GameObject playObject;
    TextMesh playMesh;

	void Start () {
        // Get game object's reference
        playObject = GameObject.Find("/RotationMain/Play");
        // Get mesh text reference
        playMesh = GetComponent<TextMesh>();
        // This is the correct way to set text color
        playMesh.color = Color.red;
	}