From 4940456cb80ad7c8659448e1d07e6e9ee9798fd3 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 27 Apr 2026 17:59:49 +0200 Subject: [PATCH] Update clock synchronization logic in RuntimeHost --- src/runtime-three/runtime-host.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index 426fc292..5cf2291c 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -5052,14 +5052,16 @@ export class RuntimeHost { uniform.value = this.volumeTime; } - if (this.currentClockState !== null && simulationDt > 0) { + if ( + this.sceneReady && + this.currentClockState !== null && + simulationDt > 0 + ) { this.currentClockState = advanceRuntimeClockState( this.currentClockState, simulationDt ); - if (this.sceneReady) { - this.syncRuntimeScheduleToCurrentClock(); - } + this.syncRuntimeScheduleToCurrentClock(); this.applyDayNightLighting(); this.clockPublishAccumulator += simulationDt;