From d566aa3721a2a67766eda1b0eceb16952013c0d3 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 1 Oct 2023 14:31:11 +0900 Subject: [PATCH] Allow "lighter" jumps by releasing jump early --- PlayerCharacterBody2D.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PlayerCharacterBody2D.gd b/PlayerCharacterBody2D.gd index 559b436..20c2205 100644 --- a/PlayerCharacterBody2D.gd +++ b/PlayerCharacterBody2D.gd @@ -53,6 +53,9 @@ func _physics_process(delta): velocity.y = JUMP_VELOCITY jump_sfx.play() + if Input.is_action_just_released("jump") and velocity.y < 0.0: + velocity.y /= 3.0 + # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. var direction = Input.get_axis("left", "right")