Skip to content

resetWorldTo

resetWorldTo(world, sceneData): Map<number, number>

Defined in: scene.ts:435

Reset the world to a previously-captured scene: despawn every current entity, then reload sceneData. Used for editor play-state isolation (snapshot before Play via serializeScene, restore on Stop), level restart, etc. Because loadSceneData no longer mutates its input, the same snapshot can be restored repeatedly. Entity ids change; the returned map is snapshot-id → new entity for callers that need to remap references/selection.

World

SceneData

Map<number, number>