I want my game to wait for a few seconds, but WaitForSeconds doesn't seem to be working

First, the context. I have a simple puzzle game. You press a button, then a thing will instantly happen. I don’t have anything in void Update.

One of my functions does five things. Each changes some text on screen. It currently does them all at the same time. But I’d like a short pause between them.

I tried creating an calling the function

    IEnumerator Example() {
        print(Time.time);
        yield return new WaitForSeconds(5);
        print(Time.time);
    }

After each, but it just ignores it.

Can you show us the code who call your coroutine ?

If you have directly binded this method in the button handler you can create another function like and bind this function on your button handler :

private bool corotouineExempleIsRunning;
public void MyButtonClick()
{
   if(!corotouineExempleIsRunning)
   {
     StartCoroutine(Exemple);
  }

public void Exemple()
{
corotouineExempleIsRunning =true;
print(Time.time);
Yield return new WaitForSeconds(5);
print(Time.time);
corotouineExempleIsRunning =false;
}
}