# How to make parabolic jump from a to b to c and so on?

I want to make a game similar to "Dancing HOP: Tiles Ball EDM Rush" I am trying to make an object jump from point a(z=0) to b(z=10) to c(z=20) and so on, keeping the z axis distance constant for each hop.

I also want to change the x axis value when the player swipes on the screen. While swiping it should move from eg. (x=0) to (x=2 or x=-2). This translation on the x axis should be in a curve, while the object keeps moving in the z axis undisturbed.

Here is the code I have so far:

IEnumerator FollowArc(Transform mover, Vector3 start, Vector3 end, float radius, float duration) {

//print(start);
//print(end);
Vector3 difference = end - start;
float span = difference.magnitude;

// Override the radius if it's too small to bridge the points.

Vector3 perpendicular = new Vector3(difference.y, -transform.position.x, difference.z) / span;

Vector3 center = start + difference / 2f + perpendicular; Vector3 toStart = start - center;

float startAngle = Mathf.Atan2(toStart.y, toStart.x); Vector3 toEnd = end - center;

float endAngle = Mathf.Atan2(toEnd.y, toEnd.x);

// Choose the smaller of two angles separating the start & end
float travel = (endAngle - startAngle + 5f * Mathf.PI) % (2f * Mathf.PI) - Mathf.PI;

float progress = 0f;
if (movingSignCheck == 0) {
travel = -travel;
} else if (movingSignCheck == 1) {
travel = -(-travel);
}

do {
float angle = startAngle + progress * travel;
mover.position = center + new Vector3(Mathf.Cos(angle), Mathf.Sin(angle)) * absRadius;
progress += Time.deltaTime / duration;

yield return null;
} while (progress < 1f);

mover.position = end;
}

• We have lots of existing Q&A about calculating parabolic trajectories under the projectile-physics tag. Can you show us how you've tried to implement this feature based on the research you've done so far? Dec 16 '19 at 14:23
• Here is my script please have a look [drive.google.com/open?id=18URlip_uAiP5mtXScyWw1xy-Mmc1Iglv] @DMGregory here is the code i am using to do this but the jump is not on the same distance difference in z axis Dec 17 '19 at 5:50
• I won't click on external links, but you're welcome to edit your question to include the relevant detail embedded in the question itself. Dec 17 '19 at 12:16
• I've taken the liberty of editing your code and example into your question as I asked you to do previously. It looks like the code you're using is from an answer I wrote last year, which is for circular arcs, not parabolic arcs as described in your question title. Can you clarify, is it circles or parabolas you want? Where have you run into trouble implementing your desired curve? Dec 18 '19 at 17:52
• Thank you so much for your cooperation ,and please recommend me either i should use parabolic or circular arcs for forward jumping , i request you to look at the video of game link please , i have tried this code in moves my object in circular left to right and right to left and i want keep moving in z axis as well with circular arc on fixed positions like 0 to 10 to 20 to 30 and so on. @DMGregory Dec 19 '19 at 5:42