VulCode

Unity jump physics

Enter the jump height and time, get the gravity and initial velocity.

Category
SCP:SL, Steam and Unity
Price
free

The tool starts in your browser.

Everything is calculated in your browser. Nothing you type is sent to our server.

How to use it in three steps

The tool as a schematic with this page's example. Each step's number stands where you take it: in the fields, at the result or outside the tool.

Unity jump physics
What you enter
Height 2 m, time to apex 0.4 s
  1. Enter the jump height in Unity units.

  2. Enter the time to the apex, or the gravity.

What you get
Physics.gravity = new Vector3(0f, -25f, 0f); rigidbody.linearVelocity = new Vector3(rigidbody.linearVelocity.x, 10f, rigidbody.linearVelocity.z);
A Rigidbody or a character controller
  1. Put the result into a Rigidbody or a character controller.

Six jumps worked out from the height

Gravity and take-off speed come from what a designer knows: how high and how long. It is plain kinematics, so the expected result comes straight from the formula.

InputFrom the formulaWhat the tool returnsResult
Inputh 2, time 0.4 sthe example from the tool's description
From the formulag = 2h / (t × t), v = 2h / t: gravity -25, take-off 10 m/s
What the tool returnsgravity -25, take-off 10 m/s
As expected
Inputh 1, time 0.5 sa lower, slower jump
From the formulag = 2h / (t × t), v = 2h / t: gravity -8, take-off 4 m/s
What the tool returnsgravity -8, take-off 4 m/s
As expected
Inputh 2, time 0,25 sa comma instead of a dot
From the formulag = 2h / (t × t), v = 2h / t: gravity -64, take-off 16 m/s
What the tool returnsgravity -64, take-off 16 m/s
As expected
Inputh 2, gravity -9.81Unity's default gravity
From the formulav = the square root of 2gh: gravity -9.81, take-off 6.264 m/s
What the tool returnsgravity -9.81, take-off 6.264 m/s
As expected
Inputh 2, gravity 9,81gravity without the minus
From the formulav = the square root of 2gh: gravity -9.81, take-off 6.264 m/s
What the tool returnsgravity -9.81, take-off 6.264 m/s
As expected
Inputh 0, time 0.4 szero height
From the formulaNo result, the tool asks for positive numbers
What the tool returnsNo result, the tool asks for positive numbers
As expected

6 of 6 cases as expected

Questions