I have a very simple co-routine and a third party asset I am using. When attaching the script to one of the third party asset game objects (which has a half a dozen or more scripts doing various stuff already on it) the co-routine works ONCE up to the yield statement and never runs again
When attached to a simple game object in the same scene, it works flawlessly as expected
There are no StopAllCouroutines I can find anywhere
There are no timing issues or anyone fiddling with the time/speed/clock times anywhere
The failure happens INSTANTLY (You don’t need to do anything other than run the scene)
No errors are thrown
Disabling (randomly) some of the third party asset scripts allowed the co-routine to run 11 times (one time) before stopping. Lots of errors in that case since the remaining third party scripts often except the missing script to exist.
The third party object is using LiteNetLib for some stuff but I couldn’t see any issues there.
Anyone have thoughts about where to look for something like this? I am guessing the third party scripts are doing SOMETHING to stop co-routines but no idea what that could be.
public class test : MonoBehaviour
{
public string oname = "default";
// Start is called before the first frame update
void Start()
{
StartCoroutine(testRoutine());
}
private IEnumerator testRoutine()
{
while (true)
{
Debug.Log(oname + " testRoutine IN");
yield return new WaitForSeconds(1f);
Debug.Log(oname + " testRoutine AFTER");
}
}
}