Behaviour

The Behaviour 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 Behaviour
module:
static getByNodeId(nodeId)

Get all behaviours attached to a specific node ID.

Parameters:

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

Returns:

A table containing all behaviours attached to the node

Return type:

table

static getByNodeIdAndScriptName(nodeId, scriptName)

Get a single behaviour 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 behaviour

Returns:

The behaviour if found, or nil

Return type:

Behaviour or nil

getNodeId()

Returns the node ID this Behaviour is attached to.

Returns:

Node ID of the attached scene object

Return type:

str or nil

getScriptName()

Returns the script name of this Behaviour.

Returns:

Script name

Return type:

str

getProperties()

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

Returns:

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

Return type:

table