unity call function after delay

Code Example - unity call function after delay

                
                        Invoke("function", 2f);//f for float
                    
                
 

Time delay csharp unity

                        
                                void start()
StartCoroutine(Text());

IEnumerator Text()  //  <-  its a standalone method
{
	Debug.Log("Hello")
    yield return new WaitForSeconds(3)
    Debug.Log("ByeBye")
}
                            
                        
 

delay in unity

                        
                                Invoke("functionname", seconds);
// this is for C#
                            
                        
 

unity csharp delay function

                        
                                void start()
{
  Invoke("DoSomething", 2);//this will happen after 2 seconds
}
void DoSomething()
{
	Debug.Log("2 seconds has passed!");
}