im not totally sure how to explain it, so ill just write what my situation is.
Im having an issue with garbage collection, and to help with it i want to encapsulate all my different scenes into individual levels. for example, a level for the main menu, and a level for the main game. iv been able to successfully do this with Open Level (By Name), but the issue is that its too slow.
Im moving away from a one level system (which was instant) to a multi level system, so i dont want this to be perceived as a performance downgrade by the people using my program (even tho technically its fixing a garbage collection/memory leak issue).
I discovered level instances work for this case. there is a small bit of lag, but its considerably better than outright loading a new level.
The only issue is that i need to be vary careful with how i spawn stuff into the world and how i manage my level instances.
Ideally id have one base/core level that does nothing other than initialize the main menu level, and then the main menu takes everything from here. The only issue is i cant seem to be able to access the main menu level as a data type, be able to cast it, or really do anything with it.
what would be really nice would be to destroy the level instance inside the level instance itself (get actor outer, cast to instanced level object), immediately after loading the next level instance. for example, i load the main game level, then immediately destroy the main menu. because they are all children of the base/core level, i would think i could do this safely.
anyways, situation explanation out of the way, anyone have any ideas how i may be able to do this?