Godot Version
4.4
Question
In a game like Angry Bird, the game shows the predicted trajectory of the bird when you are about to launch it.
Now, imagine a 3D game that you could control a cannon to shoot a cannonball, but instead of aiming like Angry Bird, I am looking for something different: imagine an RTS game that you place a cannon at a location and then you order it to shoot at a destination. Now, suppose the cannonball has a certain mass, the cannon will have to adjust its angle and apply a certain force to the cannonball so the cannonball will land at the correct position.
I would like to draw this predicted curve line of the cannonball’s trajectory. What would be the optimal way to do this?
Note: in fact, the more I think about this, I think this should be 2 questions. 1 is how to calculate in physics and work backward to get the angle and the force. 2 is how to draw the curve line with respect to the angle and the force.