# TransformDirections

> Transforms multiple directions from local space to world space writing the transformed directions to a possibly different location.

## Definition

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

## TransformDirections(ReadOnlySpan\<Vector3>, Span\<Vector3>)

Transforms multiple directions from local space to world space writing the transformed directions to a possibly different location.

```csharp
public void TransformDirections(ReadOnlySpan<Vector3> directions, Span<Vector3> transformedDirections)
```

### Parameters

**** (\[ReadOnlySpan\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The directions to be transformed, these vectors are not modified by the function unless the `transformedDirections` span overlaps.**** (\[Span\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): Receives the transformed directions, must be the same length as `directions` otherwise an exception will be thrown.  If this span overlaps `directions` other than representing the exact same elements the behaviour is undefined.

### Remarks

This operation is not affected by scale or position of the transform. The transformed vectors have the same length as the original versions.

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

You should use [Transform.TransformPoints](/engine/6000.6/script-reference/unityengine/transform/transformpoints.md) for the conversion if the vectors represent positions rather than directions.

Additional Resources: [Transform.TransformDirection](/engine/6000.6/script-reference/unityengine/transform/transformdirection.md), [Transform.InverseTransformDirections](/engine/6000.6/script-reference/unityengine/transform/inversetransformdirections.md), [Transform.TransformPoints](/engine/6000.6/script-reference/unityengine/transform/transformpoints.md), [Transform.TransformVectors](/engine/6000.6/script-reference/unityengine/transform/transformvectors.md).

## TransformDirections(Span\<Vector3>)

Transforms multiple directions from local space to world space overwriting each original direction with the transformed version.

```csharp
public void TransformDirections(Span<Vector3> directions)
```

### Parameters

**** (\[Span\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): The directions to be transformed, each is replaced by the transformed version.

### Remarks

This operation is not affected by scale or position of the transform. The transformed vectors have the same length as the original versions.

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

You should use [Transform.TransformPoints](/engine/6000.6/script-reference/unityengine/transform/transformpoints.md) for the conversion if the vectors represent positions rather than directions.

Additional Resources: [Transform.TransformDirection](/engine/6000.6/script-reference/unityengine/transform/transformdirection.md), [Transform.InverseTransformDirections](/engine/6000.6/script-reference/unityengine/transform/inversetransformdirections.md),  [Transform.TransformPoints](/engine/6000.6/script-reference/unityengine/transform/transformpoints.md), [Transform.TransformVectors](/engine/6000.6/script-reference/unityengine/transform/transformvectors.md).
