Log inGet started

ecs

The ecs namespace — the engine's Luau API reference for ecs.

The ecs namespace — 37 functions.

ecs/AudioListener

ecs.AudioListener(fields?) -> value

Typed constructor for the AudioListener component — ecs.AudioListener{...} builds a value the ecs verbs apply. Call ecs.AudioListener:schema() for its fields.

ecs/AudioSource

ecs.AudioSource(fields?) -> value

Typed constructor for the AudioSource component — ecs.AudioSource{...} builds a value the ecs verbs apply. Call ecs.AudioSource:schema() for its fields.

ecs/Camera

ecs.Camera(fields?) -> value

Typed constructor for the Camera component — ecs.Camera{...} builds a value the ecs verbs apply. Call ecs.Camera:schema() for its fields.

ecs/Collider

ecs.Collider(fields?) -> value

Typed constructor for the Collider component — ecs.Collider{...} builds a value the ecs verbs apply. Call ecs.Collider:schema() for its fields.

ecs/CollisionGroups

ecs.CollisionGroups(fields?) -> value

Typed constructor for the CollisionGroups component — ecs.CollisionGroups{...} builds a value the ecs verbs apply. Call ecs.CollisionGroups:schema() for its fields.

ecs/GaussianSplatRef

ecs.GaussianSplatRef(fields?) -> value

Typed constructor for the GaussianSplatRef component — ecs.GaussianSplatRef{...} builds a value the ecs verbs apply. Call ecs.GaussianSplatRef:schema() for its fields.

ecs/Light

ecs.Light(fields?) -> value

Typed constructor for the Light component — ecs.Light{...} builds a value the ecs verbs apply. Call ecs.Light:schema() for its fields.

ecs/Material

ecs.Material(fields?) -> value

Typed constructor for the Material component — ecs.Material{...} builds a value the ecs verbs apply. Call ecs.Material:schema() for its fields.

ecs/Mesh

ecs.Mesh(fields?) -> value

Typed constructor for the Mesh component — ecs.Mesh{...} builds a value the ecs verbs apply. Call ecs.Mesh:schema() for its fields.

ecs/Physics

ecs.Physics(fields?) -> value

Typed constructor for the Physics component — ecs.Physics{...} builds a value the ecs verbs apply. Call ecs.Physics:schema() for its fields.

ecs/PhysicsJoint

ecs.PhysicsJoint(fields?) -> value

Typed constructor for the PhysicsJoint component — ecs.PhysicsJoint{...} builds a value the ecs verbs apply. Call ecs.PhysicsJoint:schema() for its fields.

ecs/PlayerOwned

ecs.PlayerOwned(fields?) -> value

Typed constructor for the PlayerOwned component — ecs.PlayerOwned{...} builds a value the ecs verbs apply. Call ecs.PlayerOwned:schema() for its fields.

ecs/RetargetProfile

ecs.RetargetProfile(fields?) -> value

Typed constructor for the RetargetProfile component — ecs.RetargetProfile{...} builds a value the ecs verbs apply. Call ecs.RetargetProfile:schema() for its fields.

ecs/Skeleton

ecs.Skeleton(fields?) -> value

Typed constructor for the Skeleton component — ecs.Skeleton{...} builds a value the ecs verbs apply. Call ecs.Skeleton:schema() for its fields.

ecs/Sky

ecs.Sky(fields?) -> value

Typed constructor for the Sky component — ecs.Sky{...} builds a value the ecs verbs apply. Call ecs.Sky:schema() for its fields.

ecs/Tessellation

ecs.Tessellation(fields?) -> value

Typed constructor for the Tessellation component — ecs.Tessellation{...} builds a value the ecs verbs apply. Call ecs.Tessellation:schema() for its fields.

ecs/Transform

ecs.Transform(fields?) -> value

Typed constructor for the Transform component — ecs.Transform{...} builds a value the ecs verbs apply. Call ecs.Transform:schema() for its fields.

ecs/TransformConstraints

ecs.TransformConstraints(fields?) -> value

Typed constructor for the TransformConstraints component — ecs.TransformConstraints{...} builds a value the ecs verbs apply. Call ecs.TransformConstraints:schema() for its fields.

ecs/WheelCollider

ecs.WheelCollider(fields?) -> value

Typed constructor for the WheelCollider component — ecs.WheelCollider{...} builds a value the ecs verbs apply. Call ecs.WheelCollider:schema() for its fields.

ecs/bind

ecs.bind(id, component, field, mode?) -> handle?

A retained accessor for a single component field. The typed front door is ecs.get; component is the Rust component name.

ecs/bindEntities

ecs.bindEntities(ids) -> handle

Bind a batch of entity ids for retained access.

ecs/blobs/clear

ecs.blobs.clear(handle)

Release a staged blob by its handle.

ecs/blobs/get

ecs.blobs.get(handle) -> string?

Read back the bytes for a blob handle.

ecs/blobs/set

ecs.blobs.set(bytes) -> string

Stage a file's bytes and return a handle to pass through a component field.

ecs/components

ecs.components(id) -> { string }?

The public component names present on an entity or nil.

ecs/describe

ecs.describe(which?) -> table

The runtime component catalog — every component with its fields. Pass a name or descriptor for a single component's schema.

ecs/get

ecs.get(id, descriptor) -> handle?

Get a typed handle to a component on an entity or nil when the component is absent.

ecs/has

ecs.has(id, descriptor) -> boolean

Whether an entity has the given component type.

ecs/insert

ecs.insert(id, value) -> Promise

Asynchronously upsert a component value onto an entity — await the returned promise for same-tick visibility.

ecs/insertMany

ecs.insertMany(ids, value) -> number

Insert one component value into many entities in a single FFI crossing.

ecs/insertSync

ecs.insertSync(id, value)

Upsert a component value onto an entity so it is visible this tick. Raises on failure.

ecs/query

ecs.query(...) -> { entityProxy }

Like ecs.queryIds but returns entity proxies instead of id strings.

ecs/queryIds

ecs.queryIds(...) -> { string }

The entity ids holding every one of the given component types. Pass ecs. descriptors.

ecs/remove

ecs.remove(id, descriptor)

Remove a component type from an entity.

ecs/set

ecs.set(id, value)

Patch the fields of a component already present on an entity. Raises when absent — use ecs.insert to create it.

ecs/snapshot

ecs.snapshot(id) -> table?

Every native component on an entity as a nested table keyed by public component name or nil.

ecs/types

ecs.types() -> { string }

The public component names available as ecs..

  • api
  • reference