Skip to content

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

getByNodeId

static getByNodeId(nodeId)

Get all behaviours attached to a specific node ID.

Parameters

  • nodeId (string): The ID of the scene graph node

Returns

  • table: table containing all behaviours attached to the node

getByNodeIdAndScriptName

static getByNodeIdAndScriptName(nodeId, scriptName)

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

Parameters

  • nodeId (string): The ID of the scene graph node
  • scriptName (string): The script name of the behaviour

Returns

  • Behaviour|nil: behaviour if found, or nil

isActive

isActive()

Returns the active state of the behaviour. If the owner item is inactive, so are all attached behaviours

Returns

  • boolean: if active, othersise false

isInitialized

isInitialized()

Returns the initialized state of the behaviour. If true, init ran through or there is no init

Returns

  • boolean: if initialized, othersise false