# JumpPads on fixed spot [closed]

I have a problem that can't solve. I have my char standing in a fixed spot, a fixed jump force (hey the guy can jump very high but has his limits!) and a fixed landing spot(the one I want the char to land) but I must find if I'm in the right spot to jump(the jump is achievable, there are no obstable and my the char jump force can land in the right spot) then I must apply the right xforce and zforce (yforce is fixed remember? ) to steer the guy on the right spot. I've tried to implement the formula suggested but my character jumps away from the pad xD

deltaPosition = target - character_position;
sqrtTerm = Sqrt(2*-gravity.y * deltaPosition.y + MaxYVelocity* character_MaxForce);
time = (MaxYVelocity-sqrtTerm) /gravity.y;
speedSq = jumpVelocity.x* jumpVelocity.x + jumpVelocity.z *jumpVelocity.z;

if speedSq < (character_MaxForce * character_MaxForce) we have the right time so we can store the value

jumpVelocity.x = deltaPosition.x / time;
jumpVelocity.z = deltaPosition.z / time;

otherwise we try the other solution

time = (MaxYVelocity+sqrtTerm) /gravity.y;

and then store it

jumpVelocity.x = deltaPosition.x / time;
jumpVelocity.z = deltaPosition.z / time;
jumpVelocity.y = MaxYVelocity;

rigidbody_velocity = jumpVelocity;

-
I think this question would be better suited for physics.stackexchange –  M Turgeon Sep 24 '12 at 14:31

## closed as off topic by Ross Millikan, M Turgeon, William, Thomas, Ｊ. Ｍ.Sep 29 '12 at 10:42

Questions on Mathematics Stack Exchange are expected to relate to math within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

In response to the new question, where the arrival location is not at the same altitude as the departure location, let $v_y$ be the initial vertical velocity and $v_x$ the initial horizontal velocity. The path is then $(v_xt,v_yt-\frac 12 gt^2)$ Since you say $v_y$ is fixed, you can solve the quadratic to find the arrival time. You want the greater of the two values so you arrive on the downward trajectory. Given the time, you can calculate the $v_x$ you want.

-
Instead of force, think of initial velocity. Let $v_x$ be horizontal and $v_y$ be vertical. Your limit is then $v_{max} \ge \sqrt{v_x^2+v_y^2}$. The altitude at a given time will be $y=v_yt-\frac 12 gt^2$, so the time of flight is $t_f=\frac {2v_y}g$ and the distance tavelled in $x$ is $\frac {2v_xv_y}g$ You can rotate to get the jump along the right direction in the $xz$ plane. Is this in the direction you were looking for?
@PasqualeSada: In real physics, force divided by mass gives acceleration. The change in velocity is acceleration times time. So if the time is short, you can just work with change in velocity. For separating $x$ and $z$, you can regard the $v_x$ above as $v_r$, the radial velocity change. Then $v_x=v_r \cos \theta, v_z=v_r \sin \theta$ –  Ross Millikan Sep 24 '12 at 19:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9346848130226135, "perplexity": 1065.2639431933458}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-48/segments/1387345775028/warc/CC-MAIN-20131218054935-00078-ip-10-33-133-15.ec2.internal.warc.gz"}