How to make object follow path?

Hey I’m a noob here and I need help making my object follow a path. I’ve used waypoints and the nav bake function but none of them are working. I’v looked all around so and link you’ll send me I would’ve probably already look through.

The problem with this script is that the thing that I want to follow the path doesn’e even move. In fact, nothing at all happens and I have no idea why.

This is my code if you were wondering:

using UnityEngine;
using System.Collections;

public class WayPoints : MonoBehaviour {

public Transform[] wayPoint = new Transform[9];
int currentWayPoint = 1;

public float rotationSpeed = 6.0f;
public float acceleration = 1.8f;

// Use this for initialization
void Start () {
	wayPoint [0] = GameObject.Find ("WayPoint1").transform;
	wayPoint [1] = GameObject.Find ("WayPoint2").transform;
	wayPoint [2] = GameObject.Find ("WayPoint3").transform;
	wayPoint [3] = GameObject.Find ("WayPoint4").transform;
	wayPoint [4] = GameObject.Find ("WayPoint5").transform;
	wayPoint [5] = GameObject.Find ("WayPoint6").transform;
	wayPoint [6] = GameObject.Find ("WayPoint7").transform;
	wayPoint [7] = GameObject.Find ("WayPoint8").transform;		
	wayPoint [8] = GameObject.Find ("WayPoint9").transform;

}

// Update is called once per frame
void Update () {
	if (currentWayPoint == 9) {
			Destroy (this.gameObject);
			Player.lives =- 1;
		} 
		else 
			{

// walk();
}
}

void walk(){
	Quaternion rotation = Quaternion.LookRotation (wayPoint [currentWayPoint].position - transform.position);
	transform.rotation = Quaternion.Slerp (transform.rotation, rotation, Time.deltaTime * rotationSpeed);

	Vector2 wayPointDirection = wayPoint[currentWayPoint].position - transform.position;
	float speedElement = Vector2.Dot(wayPointDirection.normalized, transform.forward);
	float speed = acceleration * speedElement;
	transform.Translate (0, 0, Time.deltaTime * speed);
} 

void onTriggerEnter(Collider collider){
	if (collider.tag == "WayPoint") {
		currentWayPoint ++ ;
	}

}

}

thx for your time!

hi , i don’t know if you are still looking for an answer, but since i had the same problem and found a solution to it, i post it here for future reference.

code here:

public class WayPoints : MonoBehaviour {

	// put the points from unity interface
	public Transform[] wayPointList;

	public int currentWayPoint = 0; 
	Transform targetWayPoint;

	public float speed = 4f;

	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {
		// check if we have somewere to walk
		if(currentWayPoint < this.wayPointList.Length)
		{
			if(targetWayPoint == null)
				targetWayPoint = wayPointList[currentWayPoint];
			walk();
		}
	}

	void walk(){
		// rotate towards the target
		transform.forward = Vector3.RotateTowards(transform.forward, targetWayPoint.position - transform.position, speed*Time.deltaTime, 0.0f);

		// move towards the target
		transform.position = Vector3.MoveTowards(transform.position, targetWayPoint.position,   speed*Time.deltaTime);

		if(transform.position == targetWayPoint.position)
		{
			currentWayPoint ++ ;
			targetWayPoint = wayPointList[currentWayPoint];
		}
	} 
}

This is the answer.