From 051b6e837e44f4ad32c89085f41c7b3d37f28055 Mon Sep 17 00:00:00 2001 From: Zakarya Date: Sat, 20 Jan 2024 19:43:41 -0800 Subject: [PATCH] Now the player cannot jump when there is something in the way --- addons/fpc/character.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/fpc/character.gd b/addons/fpc/character.gd index 36c9b26..c1b8342 100644 --- a/addons/fpc/character.gd +++ b/addons/fpc/character.gd @@ -120,12 +120,12 @@ func _physics_process(delta): func handle_jumping(): if jumping_enabled: if continuous_jumping: - if Input.is_action_pressed(JUMP) and is_on_floor(): + if Input.is_action_pressed(JUMP) and is_on_floor() and !low_ceiling: if jump_animation: JUMP_ANIMATION.play("jump") velocity.y += jump_velocity else: - if Input.is_action_just_pressed(JUMP) and is_on_floor(): + if Input.is_action_just_pressed(JUMP) and is_on_floor() and !low_ceiling: if jump_animation: JUMP_ANIMATION.play("jump") velocity.y += jump_velocity