WaitForSecond

The WaitForSecond node wait for a given number of seconds.

More Information:

  • This node is using Coroutine.

Examples

In this example, the program will log “First” message to console and it will wait 1 second then it will log “Finished” message.

Flow Graph:

Generated Script:

using UnityEngine;
using System.Collections.Generic;

public class Program : MonoBehaviour {

  public void Start() {
    base.StartCoroutine(Coroutine());
  }

  public System.Collections.IEnumerator Coroutine() {
    Debug.Log("First");
    yield return new WaitForSeconds(1F);
    Debug.Log("Finished");
  }
}

Output:

First
Finished
Was this helpful to you?

Leave a Reply

Your email address will not be published. Required fields are marked *