Godot Version
4.3.stable
How do I speed up the sound of my footsteps when I run?
I'm trying to make the sound of the steps speed up when the character runs, I'm not very familiar with the use of code in terms of audio and I also didn't see if there was an option to implement it from the engine without code.
If you want to actually speed up the sound effect you would change the pitch higher. To play more footsteps you may have to stop and restart the audio player rapidly, or use polyphony, or additional AudioStreamPlayers
1 Like
But I mean how do i make the sound play faster, the only thing I can think of in code is
if Input.is_action_pressed(“run”):
$Steps.pitch_scale(0.8, 1.2)
or
if Input.is_action_just_pressed(“run”):
$RunSteps.play()
else:
$WalkSteps.play()
That is how you could implement both options I wrote about. pitch_scale
is a float though, not a function.
if Input.is_action_pressed("run"):
$Steps.pitch_scale = 1.2
else:
$Steps.pitch_scale = 0.8
Personally I think using two different audio streams is better.
I tried using 2 audio sources but they ended up overlapping each other, or when I pressed the run action nothing played but when I released it it played in a loop and stopped when I ran (I did the diametrically opposite of what I wanted)
I will try with the code you provided