delay in unity
Invoke("functionname", seconds);
// this is for C#
delay in unity
Invoke("functionname", seconds);
// this is for C#
wait in unity
IEnumerator wait(float waitTime){ //creating a function
yield return new WaitForSeconds(waitTime); //tell unity to wait!!
}
void Start(){
print("start");
wait(1); ///using function
print("Good night")
}
how to pause physics in unity c#
Physics.autoSimulation = false;
unity wait until
using UnityEngine;
using System.Collections;
public class WaitUntilExample : MonoBehaviour
{
public int frame;
void Start()
{
StartCoroutine(Example());
}
IEnumerator Example()
{
Debug.Log("Waiting for princess to be rescued...");
yield return new WaitUntil(() => frame >= 10);
Debug.Log("Princess was rescued!");
}
void Update()
{
if (frame <= 10)
{
Debug.Log("Frame: " + frame);
frame++;
}
}
}
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