C# List looping Vector3's

Short story-I have a box and I want it to patrol a list of Vector3’s in order. I want it to go through each List value and then go back to the first list value once its done. However, it seems that my code gets stuck in my ‘if’ block of my if/else. The box spins in circles extremely fast and is stuck infinitely in the if statement. Any help would be greatly appreciated!

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class NpcPatrol : MonoBehaviour {

	public List<Vector3> patrolPoints;

	//current vector we are traveling to
	private Vector3 currentPoint;
	private float moveSpeed=6;

	//how big this array is and what position we are at for patrol
	private int listMax;
	private int curIndex=0;

	// Use this for initialization
	void Start () {
		//sets the size of array
		listMax = patrolPoints.Count;
		currentPoint = patrolPoints [0];
		print (listMax);
		print (curIndex);
	}
	
	// Update is called once per frame
	void Update () {
		//travel until you get to the point
		//look at the target
		transform.LookAt (currentPoint);
		//move forward towards the target
		transform.Translate (new Vector3 (0, 0, 1) * Time.deltaTime * moveSpeed);


		//check are we at the point
		if (Vector3.Distance (transform.position, currentPoint) < 0.5) {
			//at the point change the new objective by moving ahead in the list!
			if(curIndex<listMax){
				curIndex=curIndex++;
				currentPoint=patrolPoints[curIndex];
				print(curIndex+" if");
			}
			else{
				//else we need to go back to the start of the list
				curIndex=0;
				currentPoint=patrolPoints[curIndex];
				print(curIndex+" else");
			}
		}
	}
}

[31005-screen+shot+2014-08-16+at+12.16.11+am.png|31005]

[31006-screen+shot+2014-08-16+at+12.16.17+am.png|31006]

Added some screen shots to clarify. I am in a 3d world but moving the objects in only x and z. Y is constant to .5

After debugging my code and taking a closer look I decided to rewrite this line

 curIndex=curIndex++;

and replace it with

curIndex=curIndex+1;

This fixed the issue. I was simply not updating the List position. Thank you so much for the ideas! I’ll keep them in mind as I write more scripts!

Sorry about that. Kid tested, mother approved.

public class NpcPatrol : MonoBehaviour 
{
	
	public List<GameObject> patrolPoints;
	
	//current vector we are traveling to
	public Vector3 currentPoint;
	public float moveSpeed = 0.5f;
	
	//how big this array is and what position we are at for patrol
	public int listMax;
	public int curIndex = 0;
		
	// Use this for initialization
	void Start () 
	{
		//sets the size of array
		listMax = patrolPoints.Count;
		currentPoint = patrolPoints[0].transform.position;
	}
		
	// Update is called once per frame
	void Update () 
	{
		//look at the target
		transform.LookAt(currentPoint);

		transform.Translate(Vector3.forward * (Time.deltaTime * moveSpeed));

		//check are we at the point
		if(Vector3.Distance(transform.position, currentPoint) < 0.5f)
		{
			Debug.Log("We hit a patrol point!");

			curIndex++;
			if(curIndex < listMax)
			{
				currentPoint = patrolPoints[curIndex].transform.position;
			}
			else
			{
				curIndex = 0;
				currentPoint = patrolPoints[curIndex].transform.position;
			}
		}
	}
}