Skip to content

Component Transform

Berke edited this page Jun 23, 2026 · 1 revision

Transform

The Transform component defines an entity’s position, scale, orientation, and spatial state in world space.


Properties

isValid

t.isValid

Returns whether the transform is valid.

Returns

boolean

position

t.position

World position of the entity.

[WARNING]: y and z fields are swapped. So t.position.z = World Y, t.position.y = World Z

Type

Vector3

Example

t.position = Vector3(10, 0, 5)

scale

t.scale

Local scale of the entity.

[WARNING]: y and z fields are swapped. So t.scale.z = World Y, t.scale.y = World Z

Type

Vector3

relativeHeight

t.relativeHeight

Height offset relative to the sector/floor system.

Type

number

forward

t.forward

Forward direction vector.

Type

Vector3

sectorIndex

t.sectorIndex

Index of the sector the entity belongs to.

Type

number

isDirty

t.isDirty

Marks whether the transform needs recalculation.

Type

boolean

Methods

addPosition

t:addPosition(offset)

Adds a positional offset to the current transform.


Parameters

Name Type Description
offset Vector3 Movement offset

Returns

nil

Example

t:addPosition(Vector3(1, 0, 0))

Example Usage

local t = entity.transform

t.position = Vector3(0, 5, 0)
t:addPosition(Vector3(1, 0, 0))

Clone this wiki locally