Model
Loads a glTF / glb model (with optional Draco compression). The entity is created immediately; the model meshes attach asynchronously once the file is loaded.
ts
import { Behaviour } from "@relu-interactives/spatial-ecs";
export default class SpawnModel extends Behaviour {
init() {
const objects = this.world.getObjectManagementSystem();
objects?.requestCreate("model", {
name: "Robot",
path: "/assets/models/robot.glb",
transform: { position: { x: 0, y: 0, z: 0 } },
});
}
}Payload
| Field | Type | Default | Description |
|---|---|---|---|
name | string | "Model" | Display name. |
path | string | "" | URL or local-asset path to a .glb / .gltf. If empty, an anchor is created with no mesh. |
transform | TransformData | identity | Position / rotation / scale. |
parentId | EntityId | null | null | Optional parent entity. |
Components attached
Transform, Object3DRef, Name, EntityType, ParentId, Selectable, Model, MeshGeometry. If the loaded file contains animation clips, an Animation component is also attached automatically.

