Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for sliding sound when jumping mid slide #135

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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