curved path, Slerp issue?

Hi,

EDIT :
Solved with this :

void Update () {
		if ( Input.GetKey("d") ) start = true;
		if ( start ){
			myTime = Time.time;
			start = false;
		}
		car.position = Vector3.Slerp( myArray[0], myArray[1], Time.time - myTime );

I don’t understand why the first code does not work (the car just stops at the first point in the array, and does not move), and it works with the second code, when I use car.position into the Slerp method :

//#1
car.position = Vector3.Slerp( myArray[0], myArray[1], 0.6f );

//#2
car.position = Vector3.Slerp( car.position, myArray[1], 0.6f );

 .

The #1 code comes from this source : http://whydoidoit.com/2012/04/06/unity-curved-path-following-with-easing/

Thanks for your help

Slerp() like Lerp() is designed to take a changing value between 0 and 1 as the last parameter. These functions slide between the two parameters. For example take this function call:

car.position = Vector3.Slerp( myArray[0], myArray[1], t ); 

When ‘t’ is 0, the function returns entirely myArray[0]. When ‘t’ is 1.0, it returns entirely myArray[1]. When ‘t’ is in the middle it returns a mix of the two with the value of ‘t’ determining how much of each is used in the calculation. So when you have:

Vector3.Slerp( myArray[0], myArray[1], 0.6f );

It is saying that based on the definition of Slerp(), use 40% of myArry[0] and 60% of myArray[1]. And since everything is constant, the return value never changes. This is the traditional/intended use of Lerp() and Slerp(). Now enter your second line of code:

car.position = Vector3.Slerp( car.position, myArray[1], 0.6f );

It is like your first equation, but you change the starting point each frame. So the first time, it is called it returns a point 60% between the current position, and myArray[1], but then it moves the starting point. The second time it calculates a new position 60% between the two and moves the starting position. It is kinda like the thought experiment where you are asked to walk halfway to the goal each day. You get close quickly, but you never arrive at your destination.