diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 8c98601df0..62b510bcd3 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -2797,15 +2797,19 @@ class Runtime extends EventEmitter { this.threads = []; this.threadMap.clear(); - for (const scene in this.scenes) { - if (scene.temporary) { - this.deleteScene(scene.id); - } - } + this._clearTemporaryScenes(); + // Remove all temporary scenes created during the project's run. this.resetRunId(); } + _clearTemporaryScenes () { + for (const sceneId in this.scenes) { + const scene = this.scenes[sceneId]; + if (scene.temporary) this.removeScene(sceneId); + } + } + _renderInterpolatedPositions () { const frameStarted = this._lastStepTime; const now = Date.now();