Hi - I am making a shoot 'em up, which means there’s a lot of objects being created with factories (bullets, enemy ships, explosions etc). If you play for 10 seconds then switching scenes (from game to main menu) is instant, but play for a couple of minutes and it can take 5 seconds or so to switch scene. I’m using Monarch to switch scenes.
My guess is that I’m not deleting the objects properly, or maybe I am doing something wrong with how I use Monarch.
Each time a component is finished with it gets deleted (go.delete()) but there are some objects I don’t delete when I switch scene (bullets/ enemies that are still moving. I assume that they get removed when the scene changes.
So my question is, what might I be doing wrong?
Is there a better way to delete game objects? Do I need to delete the individual elements that make up the object as well?
Do I need to delete the objects before I switch scene?