I tried the manuals WaitForSeconds example but it didn’t seem to work for me.
IEnumerator startTime()
{
Debug.Log("Starting time");
yield return new WaitForSeconds(3);
}
I placed this into both my Start() function and the update function (separately of course) and it never logged it out. The manuals example puts it into another IEnumerator thing. Perhaps part of it is that I’ve never used an IEnumerator “thing” before. Not sure the purpose or why it is used. But what I need is for it to constantly loop and have some code run after it is finished. I know how to do the looping part, and the changes I need for later, but I can’t get the WaitForSeconds to work right. Wish there was an easier way to do this, database languages imo have waiting down. Thanks!
Google “Unity Coroutines” for more information. It’s basically Unity exploiting a language feature of C# called iterator functions to pause and resume execution of a function.