Delete memory javascript VM

How can memory of a scene be released when an avatar leaves that same environment?

I believe your avatar consists of meshes.
So you may use mesh.dispose() for each of avatar meshes - AbstractMesh | Babylon.js Documentation
Or if all avatar meshes are under a node, you may use the same method to dispose a node with all its chidren - Node | Babylon.js Documentation

1 Like

And with this we achieve that when the avatar disappears from the scene the memory of the client is reduced and thus it is not saved?

It may depend on your requirements and a number of scenes which you use.
Also, if you use AssetContainer you may use removeAllFromScene() method - AssetContainer | Babylon.js Documentation and then return it back when needed with addAllToScene() method.

1 Like

ok i’ll try it. Thank

2 Likes