# Translate

> Moves the transform in the direction and distance of translation.

## Definition

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

## Translate(Vector3, Space)

Moves the transform in the direction and distance of translation.

```csharp
public void Translate(Vector3 translation, Space relativeTo)
```

### Parameters

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

### Remarks

If relativeTo is left out or set to [Space.Self](/engine/6000.0/script-reference/unityengine/space/self.md) the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is [Space.World](/engine/6000.0/script-reference/unityengine/space/world.md) the movement is applied relative to the world coordinate system.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Move the object forward along its z axis 1 unit/second.
        transform.Translate(Vector3.forward * Time.deltaTime);

        // Move the object upward in world space 1 unit/second.
        transform.Translate(Vector3.up * Time.deltaTime, Space.World);
    }
}
```

## Translate(Vector3)

Moves the transform in the direction and distance of translation.

```csharp
public void Translate(Vector3 translation)
```

### Parameters

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

### Remarks

If relativeTo is left out or set to [Space.Self](/engine/6000.0/script-reference/unityengine/space/self.md) the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is [Space.World](/engine/6000.0/script-reference/unityengine/space/world.md) the movement is applied relative to the world coordinate system.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Move the object forward along its z axis 1 unit/second.
        transform.Translate(Vector3.forward * Time.deltaTime);

        // Move the object upward in world space 1 unit/second.
        transform.Translate(Vector3.up * Time.deltaTime, Space.World);
    }
}
```

## Translate(float, float, float, Space)

Moves the transform by x along the x axis, y along the y axis, and z along the z axis.

```csharp
public void Translate(float x, float y, float z, Space relativeTo)
```

### 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)): **** (\[Space]\(/engine/6000.0/script-reference/unityengine/space)):&#x20;

### Remarks

If relativeTo is left out or set to [Space.Self](/engine/6000.0/script-reference/unityengine/space/self.md) the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is [Space.World](/engine/6000.0/script-reference/unityengine/space/world.md) the movement is applied relative to the world coordinate system.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Move the object forward along its z axis 1 unit/second.
        transform.Translate(0, 0, Time.deltaTime);

        // Move the object upward in world space 1 unit/second.
        transform.Translate(0, Time.deltaTime, 0, Space.World);
    }
}
```

## Translate(float, float, float)

Moves the transform by x along the x axis, y along the y axis, and z along the z axis.

```csharp
public void Translate(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;

### Remarks

If relativeTo is left out or set to [Space.Self](/engine/6000.0/script-reference/unityengine/space/self.md) the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is [Space.World](/engine/6000.0/script-reference/unityengine/space/world.md) the movement is applied relative to the world coordinate system.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Move the object forward along its z axis 1 unit/second.
        transform.Translate(0, 0, Time.deltaTime);

        // Move the object upward in world space 1 unit/second.
        transform.Translate(0, Time.deltaTime, 0, Space.World);
    }
}
```

## Translate(Vector3, Transform)

Moves the transform in the direction and distance of translation.

```csharp
public void Translate(Vector3 translation, Transform relativeTo)
```

### Parameters

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

### Remarks

The movement is applied relative to relativeTo's local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Move the object to the right relative to the camera 1 unit/second.
        transform.Translate(Vector3.right * Time.deltaTime, Camera.main.transform);
    }
}
```

## Translate(float, float, float, Transform)

Moves the transform by x along the x axis, y along the y axis, and z along the z axis.

```csharp
public void Translate(float x, float y, float z, Transform relativeTo)
```

### 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)): **** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)):&#x20;

### Remarks

The movement is applied relative to relativeTo's local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Move the object to the right relative to the camera 1 unit/second.
        transform.Translate(Time.deltaTime, 0, 0, Camera.main.transform);
    }
}
```
