From 11958e502031b2bd9fdf9dabdbf27e7677168aba Mon Sep 17 00:00:00 2001 From: Zakarya Date: Tue, 7 May 2024 15:48:37 -0700 Subject: [PATCH] Add smoothing for jump and land animations if they are interrupted --- addons/fpc/character.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/fpc/character.gd b/addons/fpc/character.gd index 7796e13..3890476 100644 --- a/addons/fpc/character.gd +++ b/addons/fpc/character.gd @@ -156,9 +156,9 @@ func _physics_process(delta): if !was_on_floor and is_on_floor(): # Just landed match randi() % 2: 0: - JUMP_ANIMATION.play("land_left") + JUMP_ANIMATION.play("land_left", 0.25) 1: - JUMP_ANIMATION.play("land_right") + JUMP_ANIMATION.play("land_right", 0.25) was_on_floor = is_on_floor() # This must always be at the end of physics_process @@ -168,12 +168,12 @@ func handle_jumping(): if continuous_jumping: if Input.is_action_pressed(JUMP) and is_on_floor() and !low_ceiling: if jump_animation: - JUMP_ANIMATION.play("jump") + JUMP_ANIMATION.play("jump", 0.25) velocity.y += jump_velocity else: if Input.is_action_just_pressed(JUMP) and is_on_floor() and !low_ceiling: if jump_animation: - JUMP_ANIMATION.play("jump") + JUMP_ANIMATION.play("jump", 0.25) velocity.y += jump_velocity