How can I remove mesh from scene in Babylon.js in runtime? Tried to search, didn't find, also tried to view the scene methods in debugger, also can't find.
Asked
Active
Viewed 7,442 times
2 Answers
12
You just have to use mesh.dispose();

David Catuhe
- 1,747
- 1
- 10
- 9
-
3regarding optimization : i reckon it is usefull to set the mesh variable to null after the dispose call (to tell the GC he can collect), right? – Bombinosh Aug 16 '15 at 09:57
1
I guess what you are finding for is this .
This method removes the specific mesh .
scene.removeMesh( mesh name );
Here is the example https://playground.babylonjs.com/#3UW6W3#2

Abdulla Ababakre
- 327
- 3
- 4