Skip to main content

Transform

Transform API provides methods to access and modify local transform of entity.

Note that, world transform cannot be modified by entity because it is always autocalculated from local transform.

Properties​

position: Vector3​

Local position of entity.

local position = entity.localTransform.position

entity.localTransform.position = Vector3.new(10.0, 2.5, 4.5)

scale: Vector3​

Local scale of entity.

local scale = entity.localTransform.scale

entity.localTransform.scale = Vector3.new(2.0, 2.0, 2.0)

rotation: Quaternion​

Local rotation of entity.

local rotation = entity.localTransform.rotation

entity.localTransform.rotation =
Quaternion.fromEulerAngles(math.rad(20.0), math.rad(30.0), math.rad(40.0))

Methods​

delete(): void​

Delete local transform component.

entity.localTransform:delete()