Bug fix
@@ -743,7 +743,10 @@
// Remove from scene
var index = this.getScene().meshes.indexOf(this);
- this.getScene().meshes.splice(index, 1);
+ if (index != -1){
+ // Remove from the scene if mesh found
+ this.getScene().meshes.splice(index, 1);
+ }
if (!doNotRecurse) {
// Particles
@@ -779,4 +782,4 @@
}
-}
+}