unity2d translate to position code example
Example: unity how to move character using transform
Using UnityEngine;
Using System.Collections;
public class MovementExample : MonoBehaviour
public float speed = 5f;
void update()
{
//2D Top Down
tranform.Translate(Vector3.up * Time.deltaTime * speed);
//3D
tranfrom.Translate(Vector3.forward * Time.deltaTime * speed);
}
//The more appropriate way to move in 3D is to use a Character Controller on your GameObject!