# SetLocalTransform

> Sets the local (parent-relative) position, rotation, and scale to the values encoded in a 4x4 local-to-parent matrix.

## Definition

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

## SetLocalTransform(float4x4)

Sets the local (parent-relative) position, rotation, and scale to the values encoded in a 4x4 local-to-parent matrix.

```csharp
public void SetLocalTransform(float4x4 localToParentMatrix)
```

### Parameters

**** (\[float4x4]\(/engine/7000.0/script-reference/unity/mathematics/float4x4)): A matrix representing the parent-relative affine transformation.

### Remarks

This function gives identical results to the following operations, but is more efficient:

AffineTransform.decompose(localToParentMatrix, out float3 position, out quaternion rotation, out float3 scale); transformRef.LocalPosition = position; transformRef.LocalRotation = rotation; transformRef.LocalScale = scale;

## SetLocalTransform(float3, quaternion, float3)

Sets the local (parent-relative) position, rotation, and scale to the provided values.

```csharp
public void SetLocalTransform(float3 position, quaternion rotation, float3 scale)
```

### Parameters

**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The new parent-relative position**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The new parent-relative rotation**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The new parent-relative scale

### Remarks

This function gives identical results to the following operations, but is more efficient:

transformRef.LocalPosition = position; transformRef.LocalRotation = rotation; transformRef.LocalScale = scale;
