Hello,
I have created a script which should make a slomotion effect. Therefore, I created a public void which is called on a UI-Button click. This function starts the following iEnumerator with StartCoroutine(Slomotion())
IEnumerator Slomotion()
{
doSlowMo = true;
yield return new WaitForSecondsRealtime(boost.duration);
doSlowMo = false;
}
The strange thing is that this code works in UnityEditor but not on an Android-Build. I debugged the variable “doSlowMo” on the android build and it came out that the variable is changing all the time according to the following pattern:
false, false, true, false, false, true, …
However, the StartCoroutine method is only called once after the UI event.
I tried replacing the WaitForSecondsRealtime function with a while loop but this has the same effect.
I´m really confused because the code used to work in a previous build on android, too. Maybe you know an answer to this.
Thanks in advance!