Skip to content

@relu-interactives/spatial-ecs


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

Function: unloadModelEntity() ​

ts
function unloadModelEntity(world, entityId): boolean;

Defined in: factories/objects/ModelFactory.ts:284

Take a model entity's loaded scene off it (streaming: the player is far away). The entity and its components stay, its state becomes "unloaded", and its clone's own skeletons go; the file's shared geometry and textures are freed separately once nothing else shows them (releaseAssets). Bring it back with reloadModelEntity. Returns false when there's nothing to take off.

Parameters ​

ParameterType
worldWorld
entityIdnumber

Returns ​

boolean