There is a sprite object that I would like to move from its initial position to a new position. Here is something that I tried but it is not moving from its initial position.
public Vector3 target;
public float speed;
private Vector3 position;
// Use this for initialization
void Start () {
target = new Vector3 (5, 5, 0);
position = gameObject.transform.position;
float speed = 1.0f;
}
// Update is called once per frame
void Update () {
float step = speed * Time.deltaTime;
transform.position = Vector3.MoveTowards(transform.position, target, step);
}
Some directions would help. Thanks!