Ok, so here’s my dilemma.
I’ve been using IEnumerators since I jumped into Unity to do small delays as needed. I always do something like this, and it’s no sweat.
void Start()
{
StartCoroutine(TimedExecution());
}
IEnumerator TimedExecution()
{
yield return new WaitForSeconds(1);
Debug.Log("A second has passed since this object was created");
}
However, I ran into an issue today where an object, that is not disabled, or destroyed, or being influenced by timescale in any fashion, will not execute anything after the yield statement.
I was doing some reading to understand a little bit better, and it seems that they are supposed to stop executing after the yield statement? That doesn’t make sense to me, but that seems to be happening with this one object and it’s execution of the coroutine.
In the same project, I have a coroutine executed in the same fashion, the WaitForSeconds portion is at the beginning of the IEnumerator, and it still continues to execute… but this object that gets instantiated with it’s own coroutine decided that it doesn’t want to do anything after that yield. Any yield.
The only thing that may be relevant is that this object is being spawned from an additive scene, but I don’t think that’s the issue. Any insight is welcome. Cheers!