Hey everyone, I'm with some tricky doubt here. Imagine we have a cannon which can shoot balls. In the 3D world I have an aim, which is the position where I want the ball to go. What's the best way to make the ball go in some sort of oblique launch in direction of the aim? Should I use AddForce based on distance between the cannon and the aim position in world ? Someone already implemented such a thing with success? It's not difficult to make the ball get closer to the aim. But what about make her hit the ground perfectly in the aim position?
Thanks from now!
asked May 25 '12 at 04:14 AM
That will require some math/physics. And I would not recommend using the Unity physics to do it. Setting the position of the ball is more stable. See this wikipedia page for more information: Trajectory of a Projectile I have done the maths before when I programmed a TD game, but I haven't got the code left.
answered May 25 '12 at 02:58 PM