Comments and answers for "Calculate Height of Trajectory : Unity3d"
http://answers.unity.com/questions/594385/calculate-height-of-trajectory-unity3d.html
The latest comments and answers for the question "Calculate Height of Trajectory : Unity3d"Answer by MrVerdoux
http://answers.unity.com/answers/594400/view.html
First of all, I don´t think you should recreate the whole physics system, Unity has an amazing built-in physics system, and it´s much more efficient than anything you can come up to.
But, anyway, your question has an answer. I guess you must have an initial velocity, apart form an initial position. You can calculate the angle from that initial velocity:
var initialVelocity : Vector3;
var angle : float;
function Start () {
initialVelocity = new Vector3(1,1,1);
angle = Vector3.Angle(new Vector3(initialVelocity.x,0,initialVelocity.z), initialVelocity);
}
edit: and of course, form that point use the equation pointed by robhuhn, I assumed your problem was with finding the angle.Wed, 11 Dec 2013 08:12:20 GMTMrVerdouxComment by robhuhn
http://answers.unity.com/comments/594399/view.html
Why don't you use the equation *h = pow(v * sin(θ), 2) / 2g* provided on the site you linked?Wed, 11 Dec 2013 08:10:13 GMTrobhuhn