Answers for "Jumping a specific height using Velocity & Gravity"
http://answers.unity.com/questions/854006/jumping-a-specific-height-using-velocity-gravity.html
The latest answers for the question "Jumping a specific height using Velocity & Gravity"Answer by Fonserbc
http://answers.unity.com/answers/860945/view.html
From: http://en.wikipedia.org/wiki/Acceleration#Uniform_acceleration
Using the 3rd formula you can allienate *v0* when *v* is equal to 0, when the object is on its maximum height.
v0 = sqrt(-2 * a * s)
Which in unity would be something like:
float jumpHeight = 10.0f;
rigidbody2D.velocity = new Vector2(0, Mathf.Sqrt(-2.0f * Physics2D.gravity.y * jumpHeight));
This will make the object reach quite close to the *jumpHeight*, but you have to understand that the physics simulation is not deterministic and will not * **exactly** * make the object reach your height, but it will be pretty aproximate.
That is always that you have no drag.Tue, 23 Dec 2014 10:18:36 GMTFonserbc