Skip to main content

Scenes & Roots

Dreamlab's scene graph is split into four top-level roots.
Each root decides where an entity exists and who runs its Behaviors.

RootLives on…What to put here
worldEveryone (server + all clients)Network-synced gameplay objects (terrain, NPCs, pickups).
localEach client onlyUI, the active Camera, client-side VFX, helper scripts.
serverThe server onlyGame-wide managers, match timers, scoreboards.
prefabsEditor-only (disabled at runtime)Reusable blueprints you can cloneInto another root.

Think of roots like “layers”:

  • world is the shared game world
  • local is the player's personal overlay
  • server is the omniscient referee
  • prefabs are templates you can duplicate wherever you need them

Example scene layout

Roots screenshot
Label in screenshotRootReason it lives there
SpriteworldEveryone must see the same sprite
CameralocalEach client controls its own camera
GameManagerserverRuns once on the server to track global state
Player prefabprefabsCloned into world when a player joins

Dot-path lookup (root._.<Name>)

Every root (world, local, server, prefabs) exposes a proxy called _. that lets you grab children by name with dot-syntax.

What you typeWhat it returns
game.prefabs._.PlayerThe Player entity prefab
game.prefabs._.Player._.HealthChild entity named Health
game.world._.Enemy42Runtime instance called Enemy42
game.local._.CameraThe client-side camera