I tried using

`Vector3.MoveTowards`

But it moves the object based on speed speed not time…

Is there a certain command, or should I calculate the range between two positions and calculate the speed?

I tried using

`Vector3.MoveTowards`

But it moves the object based on speed speed not time…

Is there a certain command, or should I calculate the range between two positions and calculate the speed?

I’m not really sure how you want this?

But what i think you want is something along the lines of:

```
Vector3 target;
float TimeInSeconds, distance;
void Start () {
distance = Vector3.Distance(transform.position, target);
}
void Update () {
transform.position = Vector3.MoveTowards(transform.position, target, (distance/TimeInSeconds)*Time.deltaTime);
}
```

void Start() {

StartCoroutine(MoveToPos(new Vector3(0,3,0));

}

```
public void IEnumerator MoveToPos(Vector3 endPos) {
Vector3 startPos = transform.position;
float t = 0f;
while(t < 1f) {
transform.position = Vector3.Lerp(startPos, endPos, t);
t += Time.deltaTime;
yield return null;
}
}
```