- Home /
WWW object not working properly after runtime scene load
Hi,
I have a WWW object in my IEnumerator. The code is given below. Everything works as I designed when I run this code by pressing the play button on editor. But, when I load another scene by SceneManager, everything after yield return www don't work. The commented Degug.Log("hi") line is never executed (when uncommented). The class instance this code belongs is static so it is not destroyed on load.
As everything works when I press play button, and it works within the same scene many times, the case can be replicated by trying to load another scene by SceneManager, calling this IEnumerator on static class instance which is not destroyed on load, and calling this function after SceneManager finishes loading (actually you will send a form to web server and call this function).
How should I approach this problem?
Answer by SinDeSiecle · May 27, 2018 at 07:57 PM
Solved problem like this: WWW object and the IEnumerator should not be used in a static instance. When used in the usual way (no static instances) it works perfectly.
Your answer
![](https://koobas.hobune.stream/wayback/20220612163457im_/https://answers.unity.com/themes/thub/images/avi.jpg)