How to play footsteps sounds with acceleration?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By yarkidius

Hi! So i’m prototyping a fps character controller, but I want to make the footsteps sound accelerate with the character acceleration. I’ve tried something like that:
distance += HVelocity.Length();
if(IsOnFloor()&&GroundCheck.IsColliding()&&!IsOnWall())
{
if(distance>=300)
{
EmitSignal(“Walksound”);
//this emit the signal to call a random sound
distance = 0;
}
}
It works… more or less, but the sound doesn’t play while my character is decelerating and as you can see, the footstep sound only plays when the distance reaches the desired number. Has anyone some suggestions how can I do this? I can’t do animations cause i’m blind, so 0 animations for me. thank you.