diff --git a/72d6a2a3kc.js b/72d6a2a3kc.js index 0c5f7de..675530e 100644 --- a/72d6a2a3kc.js +++ b/72d6a2a3kc.js @@ -327,9 +327,22 @@ this.enemies = this.enemies.reduce( if (enemy.lifeTime > enemy.life) { /** - * Do only a mesh remove, otherwise we also remove the material + * We only remove the things we cloned */ - enemy.mesh.remove(); + GameLib.Event.Emit( + GameLib.Event.REMOVE_COMPONENT, + { + component : enemy.mesh.materials[0] + } + ); + + GameLib.Event.Emit( + GameLib.Event.REMOVE_COMPONENT, + { + component : enemy.mesh + } + ); + } else { result.push(enemy); }