I have a menu system with TimeScale at 0. I have this, code which acts as a delay. The prints are called, but the function it calls is not fired. What would be the reason?
///DELAYS THE RETURN TWEEN FOR THE MAIN BTNS
///TIME SCALE IS AT 0
IEnumerator initMainBtnsRtnDelay(){
float delay = Time.realtimeSinceStartup + 0.7f;
while (Time.realtimeSinceStartup < delay){
yield return 0;
}
bringInStoreMainsPressed();///THIS FUNCTION DOES NOT FIRE
StopCoroutine("initMainBtnsRtnDelay");
print("adf " + Time.time);///THIS PRINT IS SHOWN
}
Unity’s Coroutine scheduler respects the timescale variable, so with timescale set to 0, the coroutines are not updated via Unity’s built-in scheduler. You could write your own scheduler, and there’s a class already written on the wiki somewhere, but the wiki is currently down for me so I can’t link you to it.
Ok thank you. So basically, I am confused tho. How could the prints print, and they delay the appropriate time. So why would a call to a function not fire? Sorry, I get what you are saying, but I dont understand why somethings things would fire but not a all important function.