# TransformDirection

> Transforms direction from local space to world space.

## Definition

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

## TransformDirection(Vector3)

Transforms direction from local space to world space.

```csharp
public Vector3 TransformDirection(Vector3 direction)
```

### Parameters

**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)):&#x20;

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector3](/engine/6000.0/script-reference/unityengine/vector3.md) |             |

### Remarks

This operation is not affected by scale or position of the transform. The returned vector has the same length as direction.

If you need the inverse operation to transform from world space to local space you can use [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md)

You should use [Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md) for the conversion if the vector represents a position rather than a direction.

If you need to transform many directions at once consider using [Transform.TransformDirections](/engine/6000.0/script-reference/unityengine/transform/transformdirections.md) instead as it is much faster than repeatedly calling this function.

Additional Resources: [Transform.TransformDirections](/engine/6000.0/script-reference/unityengine/transform/transformdirections.md), [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md), [Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md), [Transform.TransformVector](/engine/6000.0/script-reference/unityengine/transform/transformvector.md).

## TransformDirection(float, float, float)

Transforms direction x, y, z from local space to world space.

```csharp
public Vector3 TransformDirection(float x, float y, float z)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector3](/engine/6000.0/script-reference/unityengine/vector3.md) |             |

### Remarks

This operation is not affected by scale or position of the transform. The returned vector has the same length as direction.

If you need the inverse operation to transform from world space to local space you can use [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md)

You should use [Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md) for the conversion if the vector represents a position rather than a direction.

If you need to transform many directions at once consider using [Transform.TransformDirections](/engine/6000.0/script-reference/unityengine/transform/transformdirections.md) instead as it is much faster than repeatedly calling this function.

Additional Resources: [Transform.TransformDirections](/engine/6000.0/script-reference/unityengine/transform/transformdirections.md), [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md), [Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md), [Transform.TransformVector](/engine/6000.0/script-reference/unityengine/transform/transformvector.md).
