# TransformHandle

> Position, rotation and scale of an object.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IEquatable\<TransformHandle>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IComparable\<TransformHandle>](https://learn.microsoft.com/dotnet/api/system.icomparable-1)

```csharp
public struct TransformHandle : IEquatable<TransformHandle>, IComparable<TransformHandle>
```

## Remarks

Every object in a Scene has a TransformHandle. It's used to store and manipulate the position, rotation and scale of the object. Every TransformHandle can have a parent, which allows you to apply position, rotation and scale hierarchically. This is the hierarchy seen in the Hierarchy pane.

## Properties

| Property                                                                                                | Description                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [childCount](/engine/6000.7/script-reference/unityengine/transformhandle/childcount.md)                 | The number of children the parent TransformHandle has.                                                                                                                                       |
| [DirectChildren](/engine/6000.7/script-reference/unityengine/transformhandle/directchildren.md)         | An enumerable representing the direct children of this transform handle.                                                                                                                     |
| [eulerAngles](/engine/6000.7/script-reference/unityengine/transformhandle/eulerangles.md)               | The rotation as Euler angles in degrees.                                                                                                                                                     |
| [forward](/engine/6000.7/script-reference/unityengine/transformhandle/forward.md)                       | Returns a normalized vector representing the blue axis of the transform in world space.                                                                                                      |
| [hierarchyCapacity](/engine/6000.7/script-reference/unityengine/transformhandle/hierarchycapacity.md)   | The transform capacity of the transform's hierarchy data structure.                                                                                                                          |
| [hierarchyCount](/engine/6000.7/script-reference/unityengine/transformhandle/hierarchycount.md)         | The number of transforms in the transform's hierarchy data structure.                                                                                                                        |
| [localEulerAngles](/engine/6000.7/script-reference/unityengine/transformhandle/localeulerangles.md)     | The rotation as Euler angles in degrees relative to the parent transform's rotation.                                                                                                         |
| [localPosition](/engine/6000.7/script-reference/unityengine/transformhandle/localposition.md)           | Position of the transform relative to the parent transform.                                                                                                                                  |
| [localRotation](/engine/6000.7/script-reference/unityengine/transformhandle/localrotation.md)           | The rotation of the transform relative to the transform rotation of the parent.                                                                                                              |
| [localScale](/engine/6000.7/script-reference/unityengine/transformhandle/localscale.md)                 | The scale of the transform relative to the GameObjects parent.                                                                                                                               |
| [localToWorldMatrix](/engine/6000.7/script-reference/unityengine/transformhandle/localtoworldmatrix.md) | Matrix that transforms a point from local space into world space (Read Only).                                                                                                                |
| [lossyScale](/engine/6000.7/script-reference/unityengine/transformhandle/lossyscale.md)                 | The global scale of the object (Read Only).                                                                                                                                                  |
| [parent](/engine/6000.7/script-reference/unityengine/transformhandle/parent.md)                         | The parent of the transform.                                                                                                                                                                 |
| [position](/engine/6000.7/script-reference/unityengine/transformhandle/position.md)                     | The world space position of the Transform.                                                                                                                                                   |
| [right](/engine/6000.7/script-reference/unityengine/transformhandle/right.md)                           | The red axis of the transform in world space.                                                                                                                                                |
| [root](/engine/6000.7/script-reference/unityengine/transformhandle/root.md)                             | Returns the topmost transform in the hierarchy.                                                                                                                                              |
| [rotation](/engine/6000.7/script-reference/unityengine/transformhandle/rotation.md)                     | A [Quaternion](/engine/6000.7/script-reference/unityengine/quaternion.md) that stores the rotation of the Transform in world space.                                                          |
| [Subhierarchy](/engine/6000.7/script-reference/unityengine/transformhandle/subhierarchy.md)             | An enumerable representing this TransformHandle instance and all of its descendants. The TransformHandle instance itself is yielded first, followed by its descendants in depth-first order. |
| [up](/engine/6000.7/script-reference/unityengine/transformhandle/up.md)                                 | The green axis of the transform in world space.                                                                                                                                              |
| [worldToLocalMatrix](/engine/6000.7/script-reference/unityengine/transformhandle/worldtolocalmatrix.md) | Matrix that transforms a point from world space into local space (Read Only).                                                                                                                |

## Static Properties

| Property                                                                    | Description                  |
| --------------------------------------------------------------------------- | ---------------------------- |
| [None](/engine/6000.7/script-reference/unityengine/transformhandle/none.md) | An invalid transform handle. |

## Methods

| Method                                                                                                                    | Description                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DetachChildren](/engine/6000.7/script-reference/unityengine/transformhandle/detachchildren.md)                           | Unparents all of the target object's children.                                                                                                                                                                                                                                |
| [GetChild](/engine/6000.7/script-reference/unityengine/transformhandle/getchild.md)                                       | Returns a transform child by index.                                                                                                                                                                                                                                           |
| [GetDirectChildrenEnumerator](/engine/6000.7/script-reference/unityengine/transformhandle/getdirectchildrenenumerator.md) | Returns an enumerator that allows you to iterate over all direct children of this transform handle.                                                                                                                                                                           |
| [GetLocalPositionAndRotation](/engine/6000.7/script-reference/unityengine/transformhandle/getlocalpositionandrotation.md) | Updates the value of the out parameters `localPosition` and `localRotation` with the transform's current `position` and `rotation` in local space (that is, relative to its parent's `transformHandle`).                                                                      |
| [GetPositionAndRotation](/engine/6000.7/script-reference/unityengine/transformhandle/getpositionandrotation.md)           | Updates the value of the out parameters `position` and `rotation` with the transform's current `position` and `rotation` in world space (that is, relative to the scene's origin coordinates).                                                                                |
| [GetSubhierarchyEnumerator](/engine/6000.7/script-reference/unityengine/transformhandle/getsubhierarchyenumerator.md)     | Returns an enumerator that iterates over this transform handle and all of its descendants in its hierarchy.                                                                                                                                                                   |
| [HasParent](/engine/6000.7/script-reference/unityengine/transformhandle/hasparent.md)                                     | Does this transform have a parent?                                                                                                                                                                                                                                            |
| [InverseTransformDirection](/engine/6000.7/script-reference/unityengine/transformhandle/inversetransformdirection.md)     | Transforms the direction `x`, `y`, `z` from world space to local space. The opposite of [TransformHandle.TransformDirection](/engine/6000.7/script-reference/unityengine/transformhandle/transformdirection.md).                                                              |
| [InverseTransformDirections](/engine/6000.7/script-reference/unityengine/transformhandle/inversetransformdirections.md)   | Transforms multiple directions from world space to local space writing the transformed positions to a possibly different location. The opposite of [TransformHandle.TransformDirections](/engine/6000.7/script-reference/unityengine/transformhandle/transformdirections.md). |
| [InverseTransformPoint](/engine/6000.7/script-reference/unityengine/transformhandle/inversetransformpoint.md)             | Transforms the position `x`, `y`, `z` from world space to local space.                                                                                                                                                                                                        |
| [InverseTransformPoints](/engine/6000.7/script-reference/unityengine/transformhandle/inversetransformpoints.md)           | Transforms multiple positions from world space to local space writing the transformed positions to a possibly different location.                                                                                                                                             |
| [InverseTransformVector](/engine/6000.7/script-reference/unityengine/transformhandle/inversetransformvector.md)           | Transforms the vector `x`, `y`, `z` from world space to local space. The opposite of [TransformHandle.TransformVector](/engine/6000.7/script-reference/unityengine/transformhandle/transformvector.md).                                                                       |
| [InverseTransformVectors](/engine/6000.7/script-reference/unityengine/transformhandle/inversetransformvectors.md)         | Transforms the vector `x`, `y`, `z` from world space to local space writing the transformed positions to a possibly different location. The opposite of [TransformHandle.TransformVector](/engine/6000.7/script-reference/unityengine/transformhandle/transformvector.md).    |
| [IsChildOf](/engine/6000.7/script-reference/unityengine/transformhandle/ischildof.md)                                     | Is this transform a child of parent?                                                                                                                                                                                                                                          |
| [IsValid](/engine/6000.7/script-reference/unityengine/transformhandle/isvalid.md)                                         | Checks if the transform handle is valid or not.                                                                                                                                                                                                                               |
| [LookAt](/engine/6000.7/script-reference/unityengine/transformhandle/lookat.md)                                           | Rotates the transform so the forward vector points at target's current position.                                                                                                                                                                                              |
| [Rotate](/engine/6000.7/script-reference/unityengine/transformhandle/rotate.md)                                           | The implementation of this method applies a rotation of `zAngle` degrees around the z axis, `xAngle` degrees around the x axis, and `yAngle` degrees around the y axis (in that order).                                                                                       |
| [RotateAround](/engine/6000.7/script-reference/unityengine/transformhandle/rotatearound.md)                               | Rotates the transform about `axis` passing through `point` in world coordinates by `angle` degrees.                                                                                                                                                                           |
| [SetLocalPositionAndRotation](/engine/6000.7/script-reference/unityengine/transformhandle/setlocalpositionandrotation.md) | Sets the position and rotation of the Transform component in local space (i.e. relative to its parent transform).                                                                                                                                                             |
| [SetParent](/engine/6000.7/script-reference/unityengine/transformhandle/setparent.md)                                     | Set the parent of the transform.                                                                                                                                                                                                                                              |
| [SetPositionAndRotation](/engine/6000.7/script-reference/unityengine/transformhandle/setpositionandrotation.md)           | Sets the world space position and rotation of the transform.                                                                                                                                                                                                                  |
| [TransformDirection](/engine/6000.7/script-reference/unityengine/transformhandle/transformdirection.md)                   | Transforms direction `x`, `y`, `z` from local space to world space.                                                                                                                                                                                                           |
| [TransformDirections](/engine/6000.7/script-reference/unityengine/transformhandle/transformdirections.md)                 | Transforms multiple directions from local space to world space writing the transformed directions to a possibly different location.                                                                                                                                           |
| [TransformPoint](/engine/6000.7/script-reference/unityengine/transformhandle/transformpoint.md)                           | Transforms the position `x`, `y`, `z` from local space to world space.                                                                                                                                                                                                        |
| [TransformPoints](/engine/6000.7/script-reference/unityengine/transformhandle/transformpoints.md)                         | Transforms multiple points from local space to world space writing the transformed points to a possibly different location.                                                                                                                                                   |
| [TransformVector](/engine/6000.7/script-reference/unityengine/transformhandle/transformvector.md)                         | Transforms vector `x`, `y`, `z` from local space to world space.                                                                                                                                                                                                              |
| [TransformVectors](/engine/6000.7/script-reference/unityengine/transformhandle/transformvectors.md)                       | Transforms multiple vectors from local space to world space writing the transformed versions to a possibly different location.                                                                                                                                                |
| [Translate](/engine/6000.7/script-reference/unityengine/transformhandle/translate.md)                                     | Moves the transform by x along the x axis, y along the y axis, and z along the z axis.                                                                                                                                                                                        |

## Operators

| Operator                                                                                    | Description                                         |
| ------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [operator ==](/engine/6000.7/script-reference/unityengine/transformhandle/op-equality.md)   | Returns true if two TransformHandles are equal.     |
| [operator !=](/engine/6000.7/script-reference/unityengine/transformhandle/op-inequality.md) | Returns true if two TransformHandles are different. |

## Structs

| Struct                                                                                                                              | Description                                                                                                                                                                                     |
| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [TransformHandle.DirectChildrenEnumerable](/engine/6000.7/script-reference/unityengine/transformhandle/directchildrenenumerable.md) | An enumerable representing the direct children of a transform handle.                                                                                                                           |
| [TransformHandle.DirectChildrenEnumerator](/engine/6000.7/script-reference/unityengine/transformhandle/directchildrenenumerator.md) | An enumerator that allows you to iterate over all direct children of a transform handle.                                                                                                        |
| [TransformHandle.SubhierarchyEnumerable](/engine/6000.7/script-reference/unityengine/transformhandle/subhierarchyenumerable.md)     | An enumerable representing a TransformHandle instance and all of its descendants.                                                                                                               |
| [TransformHandle.SubhierarchyEnumerator](/engine/6000.7/script-reference/unityengine/transformhandle/subhierarchyenumerator.md)     | An enumerator that iterates over a TransformHandle instance and all of its descendants. The TransformHandle instance itself is yielded first, followed by its descendants in depth-first order. |
