# AddTransform

> Adds a transform to an entity.

## Definition

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

## AddTransform(Entity, float3, quaternion, float3)

Adds a transform to an entity.

```csharp
public TransformRef AddTransform(Entity entity, float3 localPosition, quaternion localRotation, float3 localScale)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The position relative to the parent, or to the world if the entity has no parent.**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The rotation relative to the parent, or to the world if the entity has no parent.**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The scale relative to the parent, or to the world if the entity has no parent.

### Returns

| Type                                                                           | Description                       |
| ------------------------------------------------------------------------------ | --------------------------------- |
| [TransformRef](/engine/7000.0/script-reference/unity/entities/transformref.md) | A reference to the new transform. |

## AddTransform(Entity, float3, quaternion)

Adds a transform with a scale of one to an entity.

```csharp
public TransformRef AddTransform(Entity entity, float3 localPosition, quaternion localRotation)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The position relative to the parent, or to the world if the entity has no parent.**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The rotation relative to the parent, or to the world if the entity has no parent.

### Returns

| Type                                                                           | Description                       |
| ------------------------------------------------------------------------------ | --------------------------------- |
| [TransformRef](/engine/7000.0/script-reference/unity/entities/transformref.md) | A reference to the new transform. |

## AddTransform(Entity, float3)

Adds a transform with no rotation and a scale of one to an entity.

```csharp
public TransformRef AddTransform(Entity entity, float3 localPosition)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The position relative to the parent, or to the world if the entity has no parent.

### Returns

| Type                                                                           | Description                       |
| ------------------------------------------------------------------------------ | --------------------------------- |
| [TransformRef](/engine/7000.0/script-reference/unity/entities/transformref.md) | A reference to the new transform. |

## AddTransform(Entity)

Adds a transform to an entity.

```csharp
public TransformRef AddTransform(Entity entity)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.

### Returns

| Type                                                                           | Description                       |
| ------------------------------------------------------------------------------ | --------------------------------- |
| [TransformRef](/engine/7000.0/script-reference/unity/entities/transformref.md) | A reference to the new transform. |
