fixed player leaving bounds check

This commit is contained in:
derek
2025-03-25 10:27:59 -05:00
parent 2e7cc249ae
commit 3e3a0d2192
5 changed files with 23 additions and 20 deletions

View File

@@ -1,13 +1,5 @@
extends Area3D
var player_exit = false
func _ready() -> void:
SignalBus.player_exiting_tree.connect(player_exit_check)
func player_exit_check():
player_exit = true
func _on_body_exited(body: Node3D) -> void:
if !player_exit:
get_tree().current_scene.die()
print("PLAYER OUT OF BOUNDS")
get_tree().current_scene.die()

View File

@@ -528,14 +528,14 @@ func punch():
func crouch(delta):
if crouched:
crouching_collision.disabled = false
#crouching_collision.disabled = false
standing_collision.disabled = true
if head.position != CROUCHED_POS:
head.position = lerp(head.position, CROUCHED_POS, delta * 8)
speed = CROUCH_SPEED
else:
standing_collision.disabled = false
crouching_collision.disabled = true
#crouching_collision.disabled = true
if head.position != STAND_POS:
head.position = lerp(head.position, STAND_POS, delta * 8)
speed = level_control.gamemode.walk_speed