@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 ​
| Parameter | Type | Default value |
|---|---|---|
world | World | undefined |
rootId | number | undefined |
dispose | boolean | true |
Returns ​
number

