Skip to main content

Transform

Client Server

Holds position, rotation, and scale

Metamethods​

boolean __eq(Transform a, Transform b)​

Methods​

Vec3 LocalToWorld(Vec3 v)​

Transforms a local position to world space, allowing you to convert coordinates relative to an object into global coordinates.

Vec3 WorldToLocal(Vec3 v)​

Converts a world position to local space, making it useful for determining an object's position relative to another object.

Vec3 LocalToWorldVec(Vec3 v)​

Vec3 WorldToLocalVec(Vec3 v)​

nil LookAt(Vec3 pos, Vec3? up)​

Adjusts the object's rotation to look at a specified point in the world, aligning it with the target position.

Properties​

Object obj​

Vec3 localPos​

The local position of the object relative to its parent

number localScale​

The local scale of the object relative to its parent

Quat localRot​

The local rotation of the object represented as a quaternion.

Vec3 localEulerRot​

The local rotation of the object represented as Euler angles.

Vec3 pos​

The global (world) position of the object

Quat rot​

The global (world) rotation of the object as a quaternion

Vec3 eulerRot​

The global (world) rotation of the object represented as Euler angles.

number scale​

The global (world) scale of the object.

Vec3 right​

The right direction vector of the object in world space.

Vec3 up​

The right direction vector of the object in world space.

Vec3 forward​

The forward direction vector of the object in world space.