Skip to content

Concepts

The ECS is organized around three primitives.

Entity

An entity is just an integer id. It owns no logic and no data on its own, everything is attached as components.

Component

A component is a typed data container. Built-in components include TransformComponent, MeshComponent, LightComponent, PhysicsComponent, and many more. Each component:

  • Extends the base Component class.
  • Holds plain state (numbers, strings, vectors, asset URLs).

See the Component Catalog for an alphabetical list with field-level docs.

System

A system queries entities by component shape and applies side effects each frame. Built-in systems handle object management, geometry, transforms, animation, rendering, and so on. As a script author you rarely interact with systems directly — you read and mutate components, and the systems do the rest.

Behaviour (Scripting)

A Behaviour is a user-authored class that runs per-frame logic on a single entity. It has full access to world, the entity's transform, its three.js Object3D, and helpers for hierarchy and math.

By default, Behaviours only execute at preview or runtime. Enable the Execute in editor toggle on a script entry in the inspector to run the full lifecycle inside the editor as well. This gives direct access to this.world.getScene(), getCamera(), and getRenderer() — useful for custom shaders, procedural geometry, grass, and other Three.js features the editor palette does not expose.

See Custom Behaviours and Running scripts in the editor.

World

The World is the runtime gateway you reach from a script via this.world. Use it to find entities, read input, query components, and access the scene/camera/renderer.

See the World for the full method list and recipes.