# TransformRef

> A reference to the transform of an entity, which can be part of a transform hierarchy.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule
* **Implements:** [IQueryTypeParameter](/engine/7000.0/script-reference/unity/entities/iquerytypeparameter.md)

```csharp
public readonly struct TransformRef : IQueryTypeParameter
```

## Properties

| Property                                                                                      | Description                                                                          |
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [HasHierarchy](/engine/7000.0/script-reference/unity/entities/transformref/hashierarchy.md)   | Returns whether this transform is currently part of a hierarchy.                     |
| [IsValid](/engine/7000.0/script-reference/unity/entities/transformref/isvalid.md)             | Whether this reference points to a transform.                                        |
| [LocalPosition](/engine/7000.0/script-reference/unity/entities/transformref/localposition.md) | The position relative to the parent, or to the world if the transform has no parent. |
| [LocalRotation](/engine/7000.0/script-reference/unity/entities/transformref/localrotation.md) | The rotation relative to the parent, or to the world if the transform has no parent. |
| [LocalScale](/engine/7000.0/script-reference/unity/entities/transformref/localscale.md)       | The scale relative to the parent, or to the world if the transform has no parent.    |

## Methods

| Method                                                                                                                    | Description                                                                            |
| ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [ComputeLocalToWorld](/engine/7000.0/script-reference/unity/entities/transformref/computelocaltoworld.md)                 | Computes the matrix that transforms from this transform's local space to world space.  |
| [GetChild](/engine/7000.0/script-reference/unity/entities/transformref/getchild.md)                                       | Gets the child entity at the specified index.                                          |
| [GetChildCount](/engine/7000.0/script-reference/unity/entities/transformref/getchildcount.md)                             | Gets the number of direct children of this transform.                                  |
| [GetChildEntities](/engine/7000.0/script-reference/unity/entities/transformref/getchildentities.md)                       | Gets all child entities.                                                               |
| [GetLocalPositionAndRotation](/engine/7000.0/script-reference/unity/entities/transformref/getlocalpositionandrotation.md) | Gets the local (parent-relative) position and rotation.                                |
| [GetParent](/engine/7000.0/script-reference/unity/entities/transformref/getparent.md)                                     | Gets the parent entity of this transform.                                              |
| [GetWorldPositionAndRotation](/engine/7000.0/script-reference/unity/entities/transformref/getworldpositionandrotation.md) | Gets the world-space position and rotation.                                            |
| [SetLocalPositionAndRotation](/engine/7000.0/script-reference/unity/entities/transformref/setlocalpositionandrotation.md) | Sets the local (parent-relative) position and rotation to the provided values.         |
| [SetLocalTransform](/engine/7000.0/script-reference/unity/entities/transformref/setlocaltransform.md)                     | Sets the local (parent-relative) position, rotation, and scale to the provided values. |
| [SetWorldPositionAndRotation](/engine/7000.0/script-reference/unity/entities/transformref/setworldpositionandrotation.md) | Sets the world-space position and rotation to the provided values.                     |
