Я сделал картинку, надеюсь, она достаточно понятна:

Вот что я пробовал (это сопрограмма):
Код: Выделить всё
GameObject movingObject = this.movingObject; //this is the object I want to move
Vector3 pointB = target.position
Vector3 pointA = start.position
Vector3 direction = (pointB-pointA).normalized;
Vector3 nextTranslation;
float t, distance, distanceCovered, parameter, speed, startTime;
distance = (targetPosition-startPosition).magnitude; //distance between A and B
distanceCovered = 0;
p = 1000f; //parameter p for the parabola
speed = 10;
startTime = Time.time;
//travel only half the distance
while (distanceCovered < (distance/2)) {
t = Time.time - startTime; //elapsed time
//I use the parabolic parametric equation to determine the next move
nextTranslation = new Vector3 (direction.x * parameter * t, (parameter/2) * Mathf.Pow(t, 2f), direction.z * parameter * t);
nextTranslation.Normalize ();
distanceCovered += speed;
pawn.transform.Translate(nextTranslation*speed, Space.World);
yield return null;
}
Подробнее здесь: https://stackoverflow.com/questions/416 ... y-in-unity