How do I add a vector3.lerp or movetoward

Not answered fully yet constantly updated.

I have a game object that has 10 specific cord positions (specific coordinates located below declared var. I need it to move randomly between these positions like every 20 seconds and make them move over time using lerp or something else, i dont know how to bring it all together i have most of it main thing is start and end coordinates var location = transform saves the location i believe but is it in right place? and would i put that variable in starting marker for lerp?

need help with at least position1/random pick 1 after that i should be able to fill in rest

any help appreciated im a beginner to coding.

You could make an array of Vector3’s that contain all your positions. Then every time you want to randomly move to a new position, use Random.Range to get a random number between 0 and 19 and use that randomized number as the array index for your target position that you lerp to. I’m a C# guy, but something like this:

Vector3[] positions;
int rand = Random.Range(0, 20);  //the "20" is not included in the possible random values
transform.position = Vector3.Lerp(transform.position, positions[rand], Time.deltaTime);