[SOLVED] From Color A to Color B - Lerp

Hi, I have primitive question, I before 2 minutes looked on Unity Learn.
He changing color with Input Z and Input C.

I now maked 3D Text and added box collider. Then created script ‘ChangeColor’.

There I writed two public class, first is Enum, seconds is ChangeColor.

In the first class I wroted OnMouseOver, OnKey.
In the seconds class I wroted:

 public type choosenTyp;
    public Color ColorOnHover;
    public Color ColorNormal;
    public KeyCode key;
    public float smooth;
    public Color now;

    void Awake() {
        now = ColorNormal;
    }

	// Update is called once per frame
	void Update () {
        gameObject.renderer.material.color = Color.Lerp(gameObject.renderer.material.color, now,  Time.deltaTime * smooth);
	}

    void OnMouseEnter() {
        if (choosenTyp == type.OnMouseOver) {
            now = ColorOnHover;
        }
    }

    void OnMouseExit() {
        if (choosenTyp == type.OnMouseOver) {
            now = ColorNormal;
        }
    }

But when I move on Text, text change color to transparent. I don’t see text. Why it doing this ?

It is likely that your ColorOnHover has an alpha value of 0.0. Click on the color in the inspector and set the ‘A’ to 255. Note when you don’t initialize your color variables, they get the color (0,0,0,0). Even if you picked a color later, the alpha will still be 0.0 unless you changed it. If you plan on using this script in the future, you might consider initializing the values to some color to avoid this problem:

public Color ColorOnHover = Color.red;

var MyObjects : GameObject;

function Update() 
  {
        MyObjects = GameObject.GameObject.FindGameObjectsWithTag("FirstTag")+GameObject.FindGameObjectsWithTag("SecondTag");

print(MyObjects.length);

  }