transform.translate unity

C#
public Transform tr; //make reference in Unity Inspector

public float SpdX = 1f;
public float SpdY = 0f;

private void Update()
{
	tr.Translate(new Vector2(SpdY, SpdX)); //no its not a typo, first goes Y then X. IDK Why
}				//you use Vector3 if you use 3dtransform.Translate(Vector3.up * Time.deltaTime, Space.World);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);
    }
}

Source

Also in C#: