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

boolean active

boolean activeInHierarchy

Object object

Object obj

boolean isDestroyed

string type

boolean Active

boolean ActiveInHierarchy

Object Object

Object Obj

boolean IsDestroyed

string Type

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.

number fingerprint

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.