Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / despawnPrefab

Function: despawnPrefab() ​

ts
function despawnPrefab(
   world, 
   rootId, 
   dispose?): number;

Defined in: prefab/spawnPrefab.ts:201

Delete a spawned prefab instance: the root entity plus every descendant (children first). Returns the number of entities removed. dispose releases GPU resources not flagged as shared (safe with the model cache).

Parameters ​

ParameterTypeDefault value
worldWorldundefined
rootIdnumberundefined
disposebooleantrue

Returns ​

number