<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [Entity](./server.entity.md) &gt; [despawn](./server.entity.despawn.md)

## Entity.despawn() method

Despawns the entity and all children from the world.

Use for: removing entities from the world. Do NOT use for: temporary hiding; consider visibility or animations instead.

**Signature:**

```typescript
despawn(): void;
```
**Returns:**

void

## Remarks

\*\*Cascading:\*\* Recursively despawns all child entities first (depth-first).

\*\*Controller:\*\* Calls `controller.detach()` then `controller.despawn()` if attached.

\*\*Cleanup:\*\* Automatically unregisters attached audios, despawns attached particle emitters, and unloads attached scene UIs from their respective managers.

\*\*Simulation:\*\* Removes from physics simulation.

\*\*Side effects:\*\* Emits `EntityEvent.DESPAWN` and unregisters from world managers.

\*\*Category:\*\* Entities

