Hi. Is there a way to properly delete assets and their materials.
In my game I need to create a new material for each enemy. I change the transparency so I give each enemy a new material that is identical to the cloned one.
If I make the texture of the enemy smaller in photoshop I can spawn more of them before the game crashes.
If I make the texture larger I can spawn way less before the game crashes.
If the materials were being properly removed. It would not matter how large the texture was.
I have tried
mesh.material.dispose();
mesh.disposeAsset();
mesh.dispose();
scene.removeChild(mesh);
none of these seem to solve the issue.
Thanks.