Problem with WaitForSeconds

I’m trying to make the GUITexture(called ‘ready’) appear and disappear after 2 seconds, so i used the following code:

IEnumerator abertura(){
	ready.enabled = true;
	yield return new WaitForSeconds(2);
	ready.enabled = false;
}

But it isn’t working. How to do it right?

Do you call function with StartCoroutine(aperture()); ?

No, i neither know what is this… :face_with_spiral_eyes:

Well all IEnumerator functions you need to call with StartCoroutine();

:slight_smile:

Can you post a sample code, please?

void Start() {
    StartCoroutine(abertura());
}

IEnumerator abertura(){

    ready.enabled = true;

    yield return new WaitForSeconds(2);

    ready.enabled = false;

}

It Works. Thanks guy!