Skip to content

GameObject bindings

SDraw edited this page Jun 14, 2023 · 7 revisions

Refer to Unity's GameObject documentation for properties and methods description.

Constructor

  • object GameObject(string name = "")

Properties

  • activeInHierarchy: get, boolean
  • activeSelf: get, boolean
  • isStatic: get/set, boolean
  • layer: get/set, boolean
  • tag: get/set, string
  • transform: get, Transform

Methods

  • bool CompareTag(string tag)
  • object GetComponent(string name)
    • Note: Only Unity's own components can be retrieved with short name (Transform, NavMeshAgent and etc.), non-standart components (such as CVRLua.LuaScript) should be retrieved with full name.
    • Warning: Do not try to access components that don't have Lua bindings, because such components can't be detected by garbage collector.
  • bool SetActive(bool state)

Static methods

  • object CreatePrimitive(string shape)

Utility functions

  • bool IsGameObject(object obj): checks if value is type of GameObject.

Notes

  • Inherits methods and properties of Object.