Time delay C# unity
void start()
StartCoroutine(Text());
IEnumerator Text() // <- its a standalone method
{
Debug.Log("Hello")
yield return new WaitForSeconds(3)
Debug.Log("ByeBye")
}
Time delay C# unity
void start()
StartCoroutine(Text());
IEnumerator Text() // <- its a standalone method
{
Debug.Log("Hello")
yield return new WaitForSeconds(3)
Debug.Log("ByeBye")
}
unity add a delay in update function
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OverTime : MonoBehaviour
{
private bool Timed;
// Start is called before the first frame update
void Start()
{
StartCoroutine(CountDown(5));
}
// Update is called once per frame
void Update()
{
if(!Timed)
{
StartCoroutine(CountDown(5));
}
}
IEnumerator CountDown(float RestartAfter)
{
Timed = true;
yield return new WaitForSeconds(RestartAfter);
print(Time.time);
Timed = false;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us