Hi, I’m making a game akin to Limbo/Inside where the level loading/unloading is meant to be seamless (eg: no load screens) I’m having an issue where GarbageCollection is causing sharp lag spikes whenever I unload a level.
I have tested loading/unloading via two methods in a packaged development build:
-
Level Streaming : Using ‘Load Stream (by Name)’ to load / ‘Unload Stream Level (by Name)’ to unload with a persistent level housing sublevels that are set initially unloaded.
-
Level Instancing : Using ‘Load Level Instance (by Name)’ to load / ‘Set is Requesting Unload and Removal’ with a persistent level with no sublevels in editor.
Both give me similar results, which look like this (which unsurprisingly creates a very distracting lag spike in-game):
My GC settings are:
Any tips on diagnosing this greatly appreciated!