Skip to content

PrefabServer

Defined in: prefab/prefabServer.ts:34

Prefab instantiation, as Res(Prefabs) hands it over.

@beta: instantiate is the whole surface and it has not moved, but its result and override shapes are spelled in the prefab document model, which is also the on-disk format — so their names are settled ahead of the shapes.

new PrefabServer(world, getAssets, getScenes?): PrefabServer

Defined in: prefab/prefabServer.ts:42

World

() => Assets

() => SceneManagerState | null

PrefabServer

instantiate(pathOrAddress, options?): Promise<InstantiatePrefabResult>

Defined in: prefab/prefabServer.ts:58

Spawn a prefab into the world. What it spawns belongs to the scene that was live when it landed, exactly like an entity that scene authored — ownerless, a bullet or a called minion leaks into the next room. Pass scene: false for something meant to outlive the area it came from.

string

string

SpawnOverride[]

number

boolean

Promise<InstantiatePrefabResult>