I’m trying to make a 2D game, where a ball will be launched from a starting position towards the mouse cursor, in a parabolic motion, with the cursor acting as the vertex of the shot. As of right now, from looking around the forums and brainstorming a bit, I have come up with pseudo-codish way to create this.
By getting the position of the vertex and the ball when it starts, and taking into account the force of gravity, I can calculate the starting angle the ball will need to be shot at to pass through the vertex. I am currently thinking of doing this using AddForce(). However, where I see a problem occurring is knowing exactly how much force to add to the ball, so that it peaks exactly at the vertex, and doesn’t fly off into the distance.
(I have no code as of yet because I don’t want to spend the time doing this with such a glaring problem. Even a proper link to some physics website that would point me in the right direction would help).
Thanks for the help,