From 2c36ef652184f6b4fc0551e67d8d9a1fa4290059 Mon Sep 17 00:00:00 2001 From: ac-arcana Date: Mon, 1 Apr 2024 10:28:09 -0700 Subject: [PATCH] Update player.gd --- COGITO/Scripts/player.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/COGITO/Scripts/player.gd b/COGITO/Scripts/player.gd index ad0dfc04..1b635282 100644 --- a/COGITO/Scripts/player.gd +++ b/COGITO/Scripts/player.gd @@ -753,7 +753,6 @@ func _physics_process(delta): #if !is_movement_paused: move_and_slide() - # FOOTSTEP SOUNDS SYSTEM = CHECK IF ON GROUND AND MOVING if is_on_floor() and velocity.length() >= 0.2: if not sliding_timer.is_stopped(): @@ -761,7 +760,9 @@ func _physics_process(delta): slide_audio_player.play() else: - slide_audio_player.stop() + if slide_audio_player: + slide_audio_player.stop() + if footstep_timer.time_left <= 0: #dynamic volume for footsteps if is_walking: @@ -777,6 +778,9 @@ func _physics_process(delta): footstep_timer.start(sprint_footstep_interval) else: footstep_timer.start(walk_footstep_interval) + elif slide_audio_player: + slide_audio_player.stop() + func _on_sliding_timer_timeout(): is_free_looking = false