# GetLocalPositionAndRotation(out Vector3, out Quaternion)

> 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 ).

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## GetLocalPositionAndRotation(Vector3, Quaternion)

```csharp
public void GetLocalPositionAndRotation(out Vector3 localPosition, out Quaternion localRotation)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Out parameter that will receive the position of the transform in local space.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): Out parameter that will receive the rotation of the transform in local space.

### Remarks

**Note**: When getting both the `localPosition` and `localRotation` of a `TransformHandle`, calling this method is slightly more efficient than querying [TransformHandle.localPosition](/engine/6000.7/script-reference/unityengine/transformhandle/localposition.md) and [TransformHandle.localRotation](/engine/6000.7/script-reference/unityengine/transformhandle/localrotation.md) individually.

If the transform has no parent, then calling this is equivalent to calling [TransformHandle.GetPositionAndRotation](/engine/6000.7/script-reference/unityengine/transformhandle/getpositionandrotation.md).

The typical usage for this method is to retrieve a transform's `position` and `rotation` in local space, to either display them or evaluate them. For example:

` transformHandle.GetLocalPositionAndRotation(out Vector3 localPosition, out Quaternion localRotation)`

The following example logs the position and rotation of a `GameObject`'s `TransformHandle` in local space.

```csharp
using UnityEngine;

// Attach this script to a GameObject as a component.
public class GetLocalPositionAndRotationExample : MonoBehaviour
{
    void Start()
    {
        // transformHandle refers to the <see cref="UnityEngine.TransformHandle"></see> of the <see cref="UnityEngine.GameObject"></see> this script is attached to.
        transformHandle.GetLocalPositionAndRotation(out Vector3 localPosition, out Quaternion localRotation);

        // We will convert the rotation <see cref="UnityEngine.Quaternion"></see> to Euler angles for readability.
        Debug.Log($"{name} is located at {localPosition}, and has the rotation {localRotation.eulerAngles} relative to its parent.");
    }
}
```

Additional Resources: [Quaternion](/engine/6000.7/script-reference/unityengine/quaternion.md), [Vector3](/engine/6000.7/script-reference/unityengine/vector3.md).
