diff --git a/Assets/Scripts/ModuleManager.cs b/Assets/Scripts/ModuleManager.cs index f29317e..11d04d8 100644 --- a/Assets/Scripts/ModuleManager.cs +++ b/Assets/Scripts/ModuleManager.cs @@ -33,6 +33,12 @@ public void Reset() Modules.Clear(); ActiveModule = null; _nodesToModules.Clear(); + + // The game only destroys active gameobjects. We need to destroy the inactive ones ourselves + foreach (BlockElementScript block in _vizzyController.ProgramTransform.GetComponentsInChildren(true)) + { + block.Destroy(); + } } public bool CanRenderNode(ProgramNode node)