Documentation

Unity Engine

Unity Engine

TransformRef

A reference to the transform of an entity, which can be part of a transform hierarchy.
Read time 1 minuteLast updated 6 days ago

Definition

public readonly struct TransformRef : IQueryTypeParameter

Properties

Property

Description

HasHierarchyReturns whether this transform is currently part of a hierarchy.
IsValidWhether this reference points to a transform.
LocalPositionThe position relative to the parent, or to the world if the transform has no parent.
LocalRotationThe rotation relative to the parent, or to the world if the transform has no parent.
LocalScaleThe scale relative to the parent, or to the world if the transform has no parent.

Methods

Method

Description

ComputeLocalToWorldComputes the matrix that transforms from this transform's local space to world space.
GetChildGets the child entity at the specified index.
GetChildCountGets the number of direct children of this transform.
GetChildEntitiesGets all child entities.
GetLocalPositionAndRotationGets the local (parent-relative) position and rotation.
GetParentGets the parent entity of this transform.
GetWorldPositionAndRotationGets the world-space position and rotation.
SetLocalPositionAndRotationSets the local (parent-relative) position and rotation to the provided values.
SetLocalTransformSets the local (parent-relative) position, rotation, and scale to the provided values.
SetWorldPositionAndRotationSets the world-space position and rotation to the provided values.