Hey I need to know if the example for this function is not working for everybody else:
Create new project, create 2 scenes, new gameobject on first scene and add the C# example script on this page:
Rename second scene to “MyBigLevel”, add both of them to the level list on player settings and press Play (on tape :P).
Loading works but … does the debug log show “Loading complete” ?
Yes I do, forgot to mention.
I suspect that the example misses a line before declaring the AsyncOperation: DontDestroyOnLoad(this)
Because of course the object where this script is attached will be destroyed as soon as the second level has been loaded (that’s why it won’t log anything to me too, but it does when I added the above line).
Actually I first got into this cause I was having issues with a persistent object (an object that I DontDestroyOnLoad) and when I tried to execute the example failed. Totally missed the DontDestroyOnLoad there.
Now I know my problem is elsewhere, thanks a lot Zio.
Ok I got why this is not working, I’ll just write in here in case someone with the same problem googles it.
I was executing a coroutine function on a GO that wasn’t being DestroyOnLoad BUT, I was destroing the sender object.
So even though the object executing the function wasn’t being destroyed, the object that had been started the coroutine was so the execution was interrupted as soon as the level was loaded.