Answers for "How do I arc a rigidbody so it lands on a target?"
http://answers.unity.com/questions/157390/how-do-i-arc-a-rigidbody-so-it-lands-on-a-target.html
The latest answers for the question "How do I arc a rigidbody so it lands on a target?"Answer by aldonaletto
http://answers.unity.com/answers/157439/view.html
I answered a similar question some time ago - the cannon shoot at 45 degrees and the ball always land on the target position (unless the target runs away before). [Clike here][1] to read this answer.
[1]: http://answers.unity3d.com/questions/145972/how-to-make-enemy-canon-ball-fall-on-mooving-targe.htmlWed, 17 Aug 2011 10:01:30 GMTaldonalettoAnswer by Julien-Lynge
http://answers.unity.com/answers/157416/view.html
First of all, if you want to spend money and exert minimum effort the free iTween package for Unity has an example project that does pretty much exactly what you're looking for ( http://itween.pixelplacement.com/examples.php ). The package of examples costs $20, so you may not want to go that route.
If you wanted to do it numerically / with realistic physics, you'd have to solve a few of basic physics equations. You have two variables that describe the motion: the initial velocity and the firing angle. Wikipedia has a great section on the parabolic equation you would need:
http://en.wikipedia.org/wiki/Trajectory#Uniform_gravity.2C_no_drag_or_wind
In a nutshell, you plug in your desired velocity or angle and range to get the required angle or velocity to hit your target. Then, turn on gravity for the rigidbody and set the initial velocity of the rigidbody. Assuming we're firing in the positive X direction:
rigidbody.velocity = new Vector3(desiredVel * Mathf.Cos(desiredAngle), desiredVel * Mathf.Sin(desiredAngle), 0f);
In any other direction the Y velocity is the same and you change the X and Z trigonometrically based on your angle around the Y axis.
If you wanted friction from the air this becomes a differential equation, and you should consult your local mathematician.Wed, 17 Aug 2011 08:48:07 GMTJulien-Lynge