unity c# run a command then wait
IEnumerator placeholder1() // weird syntax for this but its needed.
{
COODE HERE
yield return new WaitForSeconds(SECONDSHERE); //this is were the wait will happen. so position it in your func where you want to wait.
CODE HERE
} // if this returns errors its most likely because you need to include the yield return new WaitForSeconds
// if this still return errir check that you didnt clean up the tags at the top because you need the two using System.Collections; and using System.Collections.Generic; tags. So if you got rid of them just add them back.
//now we need to call the func in a void or a public void if we want to acces it outside our script.
public void placeholder2() //this can be called using a button or another scipt etc.
{
StartCoroutine(placeholder1())
}
Also in C#:
- c# connect tcp
- string format c#
- csharp datetime string format
- unity rotate object relative to camera
- how to route back to url using Request.Headers["Referer"].ToString() in asp.net core
- sqlite connection c#
- page refresh on button click in c#
- perlin noise unity
- how to compare datetime in c#
- c# how to use inovke
- list of vectors c#
- unity c# run a command then wait
- Unity if object doens't exist
- c# keyvaluepair
- get number of sundays in a month c#
- c# typeof
- c# loop through array
- asp.net core redirecttoaction with parameters
- draw sphere cast unity with program
- mouseposition unity
- unity addforceatposition
- c# remove time in datetime
- c# making a folder
- c# constructor