Entity

The Entity class represents a fundamental component within the scene graph system, serving as a container for properties and behaviors associated with nodes in the scene

Usage

This class is implicity included in every scripts, no require necessary.

Reference

class Entity
module:
static getByNodeId(nodeId)

Get all entities attached to a specific node ID.

Parameters:

nodeId (str) – The ID of the scene graph node

Returns:

A table containing all entities attached to the node

Return type:

table

static getByNodeIdAndScriptName(nodeId, scriptName)

Get a single entity attached to a node ID with a specific script name.

Parameters:
  • nodeId (str) – The ID of the scene graph node

  • scriptName (str) – The script name of the entity

Returns:

The entity if found, or nil

Return type:

Entity or nil

getNodeId()

Returns the node ID this Entity is attached to.

Returns:

Node ID of the attached scene object

Return type:

str or nil

getScriptName()

Returns the script name of this Entity.

Returns:

Script name

Return type:

str

getProperties()

Returns a table of all properties defined on the entity class.

Returns:

A table with fields: name, defaultValue, type, order

Return type:

table