# Projectile Prediction with curving

I’m working on a table tennis game, and I don’t know much calculus. I can’t figure out how to predict the ping pong ball’s movement since you will be able to put a curve on it. I’ve seen other games do it, but I just can’t figure it out. @JR01

1 Like

I don’t know if this will help but you can either use and ease behavior one the rotation of the ball if your using rotation to change the ball’s direction, or if your doing it manually I would suggest using something similar except doing it on the Y and X position of the ball.

1 Like

Not really how this works. Projectile prediction requires a parabola, but now I have to add an arch at the end, and mathematically I have no idea how to add that. JR01 may know how, since he’s got a ton of experience in this type of stuff.

My best example off the top of my head is retro bowl throwing

Doesn’t the ease behavior have custom settings to do arc like stuff, how would it not work?

1 Like

That’s a hard question to answer, but all I can really say is that that’s not algebraically how stuff works. All thrown objects follow a parabola. In algebra 1 you should learn how easing would be extremely inaccurate and not work.

1 Like

@MetaNinja might know. I’m currently testing some stuff from watching 8 minutes of a video, this is what I have so far

1 Like

So you wanna have a 3d component? Or is the motion 2d and the bounces don’t matter much?

85% yes, 15% no.

It’s still something that I did recently. And by that I mean around 3-4 months…

So anyways, I don’t know how to predict the bat of a projectile moving, but I do know how to make a slightly accurate parabola path. The method I used involves knowledge in Algebra, Geometry, and a touch of Trigonometry.

2 Likes

Based on the info I’ve received, I’m going to have to do this myself (I meant something that shows the arc before it’s thrown), it should be easy to do without a curve, but that curve is going to extremely difficult for me to try to implement with my current knowledge.

1 Like

Most equations have a variable for time, so there’s a pretty good chance you could find points along the path with that.

I built a cos curve before and you are able to find points along it at a specific time so if you wanted to do a cos curve you could adjust the length of the wave to match the distance and then find the points.

In the gif shown I am increasing the time variable by 1 for each frame. If you want I could give you the expression for this. I’ll probably see about making a proper example for this tomorrow (height is also adjustable)

Sorry for the late reply, but yeah this is possible. We’re actually doing something similar right now using eases. The Manual Ease version of the ease bundle will output the point of the ease path.

Now what you’re looking for like in the football image is a parabola formula. Now that would be possible to do with the current ease behavior, you would just have to split the distance for ease in and ease out. The From and To would look something like from starting position to center and then center to end. The center would have to be raised to make an arch. The % input would be dots along the line.

Ease1 - in:
From = start
To = (From + Start) /2 + Height of Parabola

Ease2 - out:
From = (From + Start) /2 + Height of Parabola
To = End

Now a more proper way to do this is using a parabola formula and manually factor in gravity and density to try to simulate the throw as good as possible. It may take more to mark a parabola between two points. I may look into a making an example to create parabola’s like ease bundles with separate factors.

3 Likes

Here’s a small test I just made, but I’m not satisfied with the results. I plan to make another test later with actual values that will form a parabola line (more explained in the description).
Flowlab Game Creator - Parabola Test