How to free meshes from memory fast?
Hi, I work with chunks created from scratch in my game.
Every time new chunk is created, Meshes are added to memory.
Every time old chunk is removed, Meshes are not removed from memory.
This is old problem. The only way how to remove it is via Resources.UnloadUnussedAssets(), this however takes immense amount of time and causes huge lag spikes.
Is there any other way how to delete meshes from memory?
I also tried:
MeshFilter.mesh.clear()
MeshFilder.mesh = null
GC.Collect() won`t help since meshes are on C++ side.
Is there any other way how to get rid of meshes without unloading all unused assets from game?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612070136im_/https://answers.unity.com/themes/thub/images/avi.jpg)