Skip to main content

GameObject

A GameObject is an object that represents a game object in the game.

Class Instance Methods

GameObject:GetPosition(): vec3

Returns the position of the game object.

Returns: vec3 - The position of the game object

Example:

local position = gameObject:GetPosition()
print("Game object position: " .. tostring(position))

GameObject:GetRotation(): quat

Returns the rotation of the game object.

Returns: quat - The rotation of the game object

Example:

local rotation = gameObject:GetRotation()
print("Game object rotation: " .. tostring(rotation))

GameObject:GetEulerRotation(): quat

Returns the euler rotation of the game object.

Returns: vec3 - The euler rotation of the game object

Example:

local eulerRotation = gameObject:GetEulerRotation()
print("Game object euler rotation: " .. tostring(eulerRotation))