Skip to content

Instantly share code, notes, and snippets.

@willnationsdev
Created December 21, 2017 15:40
Show Gist options
  • Save willnationsdev/8d3f74f890c39d24a86fac1fe21b34c1 to your computer and use it in GitHub Desktop.
Save willnationsdev/8d3f74f890c39d24a86fac1fe21b34c1 to your computer and use it in GitHub Desktop.
Specify Jump height in Godot 2D
export var jump_height = 128.0 # px
...
var g = ProjectSettings.get("physics/2d/default_gravity_vector").y * ProjectSettings.get("physics/2d/default_gravity") # px / s ^2
var jump_velocity = sqrt(2 * g * jump_height) # px / s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment