Skip to content

Commit

Permalink
Merge pull request #135 from ac-arcana/main
Browse files Browse the repository at this point in the history
Fix for sliding sound when jumping mid slide
  • Loading branch information
Phazorknight authored Apr 1, 2024
2 parents 2a35472 + 6eca6d9 commit 45e552a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions COGITO/Scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -753,15 +753,16 @@ 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():
if !slide_audio_player.playing:
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:
Expand All @@ -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
Expand Down

0 comments on commit 45e552a

Please sign in to comment.