Hi,

I am trying to figure out how I can make an object move through a set of positions…

I have an object and a set of position, like 5 different positions, for example. So, I would like to do my object go from point 1 to point 2, from point 2 to point 3, from point 3 to point 4 and, finally, from point 4 to point 5, smoothly.

I read answers like this one Move an object through a set of positions - Questions & Answers - Unity Discussions and this one Make an object move from Point A to Point B then back to Point A repeating - Questions & Answers - Unity Discussions, particularly. I’ve implemented this last one, but nothing happens. This is my code:

```
for(int i = 0; i < number_pos-1; i++)
{
StartCoroutine(moveB(positions*, positions[i+1], 2.0f));*
```

_ //StartCoroutine(moveA(positions*, positions[i+1]);*_
_* }

*_*

_}*_

_

** IEnumerator moveA (Vector3 pointA, Vector3 pointB)**

** {**

*_ transform.position = Vector3.Lerp(pointA, pointB, Time.time * smooth);_*

** yield break;**

** }**

** IEnumerator moveB (Vector3 pointA, Vector3 pointB, float time)**

** {**

** float i = 0.0f;**

** float rate = 1.0f/time;**

** while (i < 1.0) {**

*_ i += Time.deltaTime * rate;_*

** transform.position = Vector3.Lerp(pointA, pointB, i);**

** yield break;**

** }**

** }**

*Thanks for any help!*