Skip to content

Search

Documentation

transform

The node's position, rotation_euler, scale and skew in its parent's space. A node without one sits at its parent.

På denne siden

2d · 3d · 4 properties · 2D

The node's position, rotation_euler, scale and skew in its parent's space. A node without one sits at its parent.

In a scene, transform is the node key that applies it. A script reaches each property below as a field on node.transform: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.transform.get() and node.transform.set(table).

Properties

property type default description
position vec3 [0,0,0] Where the node sits in its parent's space
rotation_euler vec3 [0,0,0] Local rotation as euler angles in radians, x then y then z
scale vec3 [1,1,1] Size relative to the parent's
skew float 0 A 2D shear in radians: how far the y axis leans past square with the x axis; children lean with it

Script functions

Methods of node.transform, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().

From node:

method what it does
global_position() -> Vec3 The node's position in world space, as of the last transform sync.
global_rotation_euler() -> Vec3 The node's world rotation as euler angles in radians, as of the last transform sync.
global_scale() -> Vec3 The node's scale in world space, as of the last transform sync.
translate(float, float, float) Move the node by an offset in its parent's space, given as three numbers or one vector.