Skip to content

Transform

Represents the position, rotation, and scale of a GameObject in 3D space. Nearly every VRChat interaction involves reading or modifying a Transform to move objects, orient players, or build dynamic world elements.

Properties

PropertyTypeAccess
childCountintget
eulerAnglesVector3get, set
forwardVector3get, set
gameObjectGameObjectget
hasChangedboolget, set
hierarchyCapacityintget, set
hierarchyCountintget
localEulerAnglesVector3get, set
localPositionVector3get, set
localRotationQuaternionget, set
localScaleVector3get, set
localToWorldMatrixUnityEngineMatrix4x4get
lossyScaleVector3get
namestringget, set
parentTransformget, set
positionVector3get, set
rightVector3get, set
rootTransformget
rotationQuaternionget, set
transformTransformget
upVector3get, set
worldToLocalMatrixUnityEngineMatrix4x4get

forward

The blue axis (Z+) direction of the object in world space.

let dir: Vector3 = transform.forward

localPosition

Position relative to the parent Transform.

transform.localPosition = Vector3.zero

localRotation

Rotation relative to the parent Transform.

transform.localRotation = Quaternion.identity

localScale

Scale relative to the parent Transform.

transform.localScale = Vector3.one

parent

The parent Transform of this object, or null if it is a root object.

let parentTransform: Transform = transform.parent

position

World-space position of the object as a Vector3.

let pos: Vector3 = transform.position

The red axis (X+) direction of the object in world space.

let side: Vector3 = transform.right

rotation

World-space rotation of the object as a Quaternion.

transform.rotation = Quaternion.Euler(0.0, 90.0, 0.0)

up

The green axis (Y+) direction of the object in world space.

let upDir: Vector3 = transform.up

Methods

DetachChildren

DetachChildren() -> void

Equals

Equals(other: object) -> bool

Find

Find(n: string) -> Transform

Finds a child Transform by name path. Returns null if not found.

let door: Transform = transform.Find("Room/Door")

GetChild

GetChild(index: int) -> Transform

Returns the child Transform at the given index.

let child: Transform = transform.GetChild(0)

GetComponent

GetComponent(type: string) -> UnityEngineComponent
GetComponent(type: SystemType) -> UnityEngineComponent
GetComponent(type: SystemType) -> UnityEngineObject

GetComponentInChildren

GetComponentInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObject
GetComponentInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponent
GetComponentInChildren(t: SystemType) -> UnityEngineComponent
GetComponentInChildren(type: SystemType) -> UnityEngineObject

GetComponentInParent

GetComponentInParent(includeInactive: bool, type: SystemType) -> UnityEngineObject
GetComponentInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponent
GetComponentInParent(t: SystemType) -> UnityEngineComponent
GetComponentInParent(type: SystemType) -> UnityEngineObject

GetComponents

GetComponents(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> void
GetComponents(type: SystemType, results: SystemCollectionsGenericList`1[[UnityEngineComponent, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetComponents(type: SystemType) -> UnityEngineComponent[]
GetComponents(type: SystemType) -> UnityEngineObject[]

GetComponentsInChildren

GetComponentsInChildren(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> void
GetComponentsInChildren(includeInactive: bool, result: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetComponentsInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObject[]
GetComponentsInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponent[]
GetComponentsInChildren(t: SystemType) -> UnityEngineComponent[]
GetComponentsInChildren(type: SystemType) -> UnityEngineObject[]

GetComponentsInParent

GetComponentsInParent(includeInactive: bool, results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetComponentsInParent(includeInactive: bool, type: SystemType) -> UnityEngineObject[]
GetComponentsInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponent[]
GetComponentsInParent(t: SystemType) -> UnityEngineComponent[]
GetComponentsInParent(type: SystemType) -> UnityEngineObject[]

GetEnumerator

GetEnumerator() -> SystemCollectionsIEnumerator

GetHashCode

GetHashCode() -> int

GetInstanceID

GetInstanceID() -> int

GetLocalPositionAndRotation

GetLocalPositionAndRotation(localPosition: Vector3, localRotation: Quaternion) -> Quaternion

GetPositionAndRotation

GetPositionAndRotation(position: Vector3, rotation: Quaternion) -> Quaternion

GetSiblingIndex

GetSiblingIndex() -> int

GetType

GetType() -> SystemType

InverseTransformDirection

InverseTransformDirection(x: float, y: float, z: float) -> Vector3
InverseTransformDirection(direction: Vector3) -> Vector3

InverseTransformPoint

InverseTransformPoint(x: float, y: float, z: float) -> Vector3
InverseTransformPoint(position: Vector3) -> Vector3

InverseTransformVector

InverseTransformVector(x: float, y: float, z: float) -> Vector3
InverseTransformVector(vector: Vector3) -> Vector3

IsChildOf

IsChildOf(parent: Transform) -> bool

LookAt

LookAt(target: Transform, worldUp: Vector3) -> void
LookAt(target: Transform) -> void
LookAt(worldPosition: Vector3, worldUp: Vector3) -> void
LookAt(worldPosition: Vector3) -> void

Rotates the transform so its forward vector points at a target position.

transform.LookAt(targetTransform)

Rotate

Rotate(xAngle: float, yAngle: float, zAngle: float, relativeTo: UnityEngineSpace) -> void
Rotate(xAngle: float, yAngle: float, zAngle: float) -> void
Rotate(axis: Vector3, angle: float, relativeTo: UnityEngineSpace) -> void
Rotate(axis: Vector3, angle: float) -> void
Rotate(eulers: Vector3, relativeTo: UnityEngineSpace) -> void
Rotate(eulers: Vector3) -> void

Applies a rotation around the given axes in degrees.

transform.Rotate(0.0, 45.0, 0.0)

RotateAround

RotateAround(point: Vector3, axis: Vector3, angle: float) -> void

SetAsFirstSibling

SetAsFirstSibling() -> void

SetAsLastSibling

SetAsLastSibling() -> void

SetLocalPositionAndRotation

SetLocalPositionAndRotation(localPosition: Vector3, localRotation: Quaternion) -> void

SetParent

SetParent(parent: Transform, worldPositionStays: bool) -> void
SetParent(p: Transform) -> void

Assigns a new parent Transform, optionally preserving world position.

transform.SetParent(newParent)

SetPositionAndRotation

SetPositionAndRotation(position: Vector3, rotation: Quaternion) -> void

SetSiblingIndex

SetSiblingIndex(index: int) -> void

ToString

ToString() -> string

TransformDirection

TransformDirection(x: float, y: float, z: float) -> Vector3
TransformDirection(direction: Vector3) -> Vector3

TransformPoint

TransformPoint(x: float, y: float, z: float) -> Vector3
TransformPoint(position: Vector3) -> Vector3

TransformVector

TransformVector(x: float, y: float, z: float) -> Vector3
TransformVector(vector: Vector3) -> Vector3

Translate

Translate(x: float, y: float, z: float, relativeTo: UnityEngineSpace) -> void
Translate(x: float, y: float, z: float, relativeTo: Transform) -> void
Translate(x: float, y: float, z: float) -> void
Translate(translation: Vector3, relativeTo: UnityEngineSpace) -> void
Translate(translation: Vector3, relativeTo: Transform) -> void
Translate(translation: Vector3) -> void

Moves the transform by the given offset in its local or world space.

transform.Translate(0.0, 1.0, 0.0)