I have a scene where a field of text is to fade in by raising the alpha channel over time. The effect works, but I would like to have it wait for a few seconds before it starts fading in. I know “yield.WaitForSeconds” doesn’t work in the update function, and I’ve read online about Coroutines, but I don’t really understand them. How could I incorporate this function into my code?
private var myRenderer : Renderer;
function Start () {
myRenderer = renderer;
yield WaitForSeconds(5);
}
function Update () {
//yield WaitForSeconds(5);
if (myRenderer.material.color.a < 255)
myRenderer.material.color.a += 25.0*Time.deltaTime;
}