Log inGet started

Entity

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

The Entity namespace — 15 functions.

globals/Entity/allTypes

globals/Entity/allTypes() -> { string }

List all registered reflectable component types in this engine instance.

globals/Entity/distance

globals/Entity/distance(entityIdA: string, entityIdB: string) -> number?

Compute the straight-line distance between two entities' Transform.position fields.

globals/Entity/getComponents

globals/Entity/getComponents(entityId: string) -> { string }?

List all reflected component types on an entity.

globals/Entity/getField

globals/Entity/getField(entityId: string, component: string, field: string) -> any

Get a specific component field value via the __reflect FFI.

globals/Entity/getName

globals/Entity/getName(entityId: string) -> string?

Get the name of an entity from its Name component.

globals/Entity/getPosition

globals/Entity/getPosition(entityId: string) -> Vec3?

Get the position of an entity — shortcut for getField(id, "Transform", "position").

globals/Entity/getRotation

globals/Entity/getRotation(entityId: string) -> Quat?

Get the rotation of an entity — shortcut for getField(id, "Transform", "rotation").

globals/Entity/getScale

globals/Entity/getScale(entityId: string) -> Vec3?

Get the scale of an entity — shortcut for getField(id, "Transform", "scale").

globals/Entity/getSchema

globals/Entity/getSchema(componentName: string) -> { ComponentFieldSchema }?

Get the full schema of a component type — field names + types.

globals/Entity/isVisible

globals/Entity/isVisible(entityId: string) -> boolean

Check if an entity is visible — reads the Visible component. Missing component is treated as visible.

globals/Entity/patch

globals/Entity/patch(entityId: string, component: string, fields: { [string]: any }) -> boolean

Patch multiple fields on a single component at once.

globals/Entity/setField

globals/Entity/setField(entityId: string, component: string, field: string, value: any) -> boolean

Set a specific component field value via the __reflect FFI.

globals/Entity/setPosition

globals/Entity/setPosition(entityId: string, pos: Vec3)

Set the position of an entity — shortcut for setField(id, "Transform", "position", pos).

globals/Entity/setScale

globals/Entity/setScale(entityId: string, scale: Vec3)

Set the scale of an entity — shortcut for setField(id, "Transform", "scale", scale).

globals/Entity/snapshot

globals/Entity/snapshot(entityId: string) -> any

Snapshot all reflected components on an entity into a { ComponentName = { field = value, ... }, ... } map.

  • api
  • reference