I have an issue with level changing, and it’s quite weird, don’t know what happened:
I have two separated scenes, when you finish the first one, the second one was loaded and there was no problem, in fact, I have a published demo version which worked just fine:
(you just have to grab the dragger to the other extreme 3 times)
this morning I was working on another script (the canvas avobe), different from the loader script, then suddenly an error kept on coming after loading :
I think I may be doing wrong loading levels. I used app.root.destroy(); and then loaded the level, but I think there are still some Childs in the hierarchy, or at least some stuff loaded. How can I check that and how can I fix it?
Never destroy app.root.
Btw, app.root - is not root entity of your scene (I know it is weird, and I’m personally not happy with that too, but it is the way it is).
So all roots of scenes go as children to app.root, so you can destroy them from there.
So, I changed the way I swapped levels and seems to be working better now.
Now, I renamed the Root Entity and, when changing levels, delete it and load the new one.
By the way, when I do this, some scripts seems from the previous scene seems to be still loaded, in fact in some computers I’ve detected playback is slower as I navigate through scenes, (it does not happen when I load the scenes separatedly). Is there something else I’m missing?
When talking about assets, then you need to clear them yourself.
You can use tags on assets to mark specific assets, and then find them using findByTag. Then unload and release associated resources with assets. It is an asset.resource - you need to remove usually.