Use Vector Lerp or other to move back with arc

Hi guys can you tell me how can I use Vector Lerp to move back to start position with arc. Check image below :

6675-lerp.jpg

When we press button gameobject move from other position to start position but back with arc like on image.Can you help me with this ?

There are a number of ways to creating this movement. Dave Carlile’s suggestion of using a spline can easily be implemented in iTween (a free addon package to Unity). Probably other packages as well. Slerp will do the job, but you might have trouble hitting percise values like z=1 if that is what you are looking for. If you wanted more control of the arcs you could handle the movement yourself with sine curves. Something line:

void MoveObject(float fFraction)
{
	Vector3 v3Delta = v3EndPos - v3StartPos;
	Vector3 v3Pos = v3StartPos;
	v3Pos.x += v3Delta.x * fFraction;
	v3Pos.y += v3Delta.y * fFraction + Mathf.Sin (fFraction * Mathf.PI) * fYFactor;
	v3Pos.z += v3Delta.z * fFraction + Mathf.Sin (fFraction * Mathf.PI) * fZFactor;
	transform.position = v3Pos;
}

This would be called by Update(). fFraction is the fraction of the way between start and end to place the object. fYFactor and fZFactor are the amount you want to offset at the max in the Y and Z directions.

If a circular arc is OK, you can use Vector3.Slerp with an origin between your two positions and with negative Z.