Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Silicon Power on February 25, 2022, 08:36:38 PM
-
Hi. My game is an open world game and I need to load and unload objects because otherwise it uses too much of memory. Destroy game objects won't help it can't free up memory. ""Resources Un Load Unused Assets" action can free memory but it makes my game leggy.
Is there any action to unload only one game object from memory and not all unused assets?
-
Hi.
If these objects are reusable you should look into pooling.
A different way is having a grid scenes system and load/unload scenes
-
Hi.
If these objects are reusable you should look into pooling.
A different way is having a grid scenes system and load/unload scenes
No I need to load buildings from resources folder and unload when player is getting far from that building. Resource Load action can load but there is no action to unload that building again.
-
Hi.
Resources Load (objects) Does the same as Create object, except its getting the reference from the resource folder.
If there are many object that can be reused you might be able to create pools, after you got it from resources load.
But i think loading/unloading scenes (depending on player position) will still be better.
-
Hi.
Resources Load (objects) Does the same as Create object, except its getting the reference from the resource folder.
If there are many object that can be reused you might be able to create pools, after you got it from resources load.
But i think loading/unloading scenes (depending on player position) will still be better.
I tried load/unload scene too but even unloading a scene doesn't free up memory :'( The only action that works is "Resource Un Load Unused Assets" but it makes the game leggy because it unload all unused assets at once.
-
Hi.
I'll ask to someone i know that uses this system how he handles memory.
-
Hi.
I'll ask to someone i know that uses this system how he handles memory.
Awesome thank you a lot.
-
Hello,
Djaydino pointed me to check this thread.
Indeed there are issues with unloading and using the unload all unused assets made some players experience crashes even when used in unnoticeable spots like during menu loading or similar. Also the frame drops as you mentioned if used on regular basis was not acceptable.
I went for additive scene loading for buildings and it helped for overall experience, still to polish it, but since buildings tend to repeat in areas all do not have to be unloaded.
It may be different on your project, but maybe we could request new action to unload specific asset https://docs.unity3d.com/ScriptReference/Resources.UnloadAsset.html