Version: 5.5
public void Translate (Vector3 translation, Space relativeTo= Space.Self);

説明

translation の方向と距離に移動します

If relativeTo is left out or set to Space.Self 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 the movement is applied relative to the world coordinate system.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Update() { transform.Translate(Vector3.forward * Time.deltaTime); transform.Translate(Vector3.up * Time.deltaTime, Space.World); } }

public void Translate (float x, float y, float z, Space relativeTo= Space.Self);

説明

Transform を x軸に沿って x、 y 軸に沿って y、z 軸に沿って z、移動させます。

If relativeTo is left out or set to Space.Self 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 the movement is applied relative to the world coordinate system.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Update() { transform.Translate(0, 0, Time.deltaTime); transform.Translate(0, Time.deltaTime, 0, Space.World); } }

public void Translate (Vector3 translation, Transform relativeTo);

説明

translation の方向と距離に移動します

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.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Update() { transform.Translate(Vector3.right * Time.deltaTime, Camera.main.transform); } }

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

説明

Transform を x軸に沿って x、 y 軸に沿って y、z 軸に沿って z、移動させます。

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.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Update() { transform.Translate(Time.deltaTime, 0, 0, Camera.main.transform); } }