Seems more reliable than the original method but not perfect

This commit is contained in:
derek
2024-10-29 16:18:39 -05:00
parent 7bf8a0744b
commit 00aa8db85d
10 changed files with 27 additions and 21 deletions

View File

@@ -210,10 +210,11 @@ func _physics_process(delta):
#Land Sound
if velocity.y < .1 and self.is_on_floor() and moving_fast == true:
print("LAND SOUND")
var land_volume = clamp( moving_fast_top_speed - 20 ,-10,0)
var recoil_amount = Vector3(-.1,0,0)
land_sound.volume_db = land_volume
land_sound.play()
recoil.add_recoil(recoil_amount,10,2)
moving_fast_top_speed = 0.0
moving_fast = false