- Home /
How much force does my 2d ball need to fly from point A to B ?
In the picture you can see how one of my shoot could look. The player is able to shoot in all directions but I don't get which exact Force I need when gravity is ablied.
I would like the ball to reach that point after like 1 second. I don't want that it flies to high. I would be good if it nearly flies straight.
Can you give me some example or something please?
Bit late but if you simply want it to fly more or less strait why not simply disable gravity on it for the duration of its flight? Once it hits you can turn that back on .... but setting that aside.
if you want to calculate parabolic trajectory as noted have a read of this
https://vilbeyli.github.io/Simple-Trajectory-$$anonymous$$otion-Example-Unity3D/
It goes through examples and walks your through the problem.
The search term you want is parabolic trajectory. That will give you a ton info on how to calculate various aspects of that topic.
At one point we built a kit to help this topic but didn't get much interest ... if I can find that old code I can share it but as I recall it wasn't as hard as it first sounds.
Answer by lgarczyn · Nov 18, 2019 at 01:48 AM
The problem is that there's an infinity of different paths the player could send the ball that would pass through point B. If you fire it with an extremely large force, you can basically shoot straight at it.
You can limit the time it will take to reach B, or the maximum starting velocity, or the angle, but you need to give more information on what do you want the ballistic trajectory to look like.
After that, it's basically simply looking for a parabola that passes through two points, it's an easy mathematically problem.