Playing footstep sound?

Hi there!

So basically, my issue is that my audio is working when I walk as I use if(Input.GetKey…) statement, but then when the player is !Grounded (basically jumps), I make the audio stop. When player reaches ground again and was already moving in air, then the audio still stops. I can find logic in that because I check with GetKey and not GetKeyDown, but when I do GetKeyDown it practically keeps on playing itself until not actually playing as it’s called each frame.

Help me please, I cannot find any logic here :frowning:

Hi Sykoo,

Is there a sound played as part of the jumping function? If so - I imagine this is cutting into the loop of the footstep sound. Also, does the sound continue if you quickly release and re-press “forward”?

No it doesn’t contain any jumping sound. And no it ain’t continueing, it starts over.

Sorry, start over is what I meant.

Are you able to post the script that activates the sound?

if(Input.GetKeyDown(KeyCode.D))
{
audio.Play();
}

thank you for your concern :slight_smile:

and this is in your update function? can we see your full update()?

I’ll post it soon. Yes, it is in my update function. Then I just check if the player is grounded or not. If not grounded, then audio stops no matter if player is walking. But when he reaches ground and gets grounded again then audio plays but it ain’t working.

hi soykoo did you solve the problem ?

Tutuapp 9apps Showbox

if(Input.GetKeyDown(KeyCode.D))
{
audio.Play();
}
Now you can easily play audio and video and stream your favorite movies on your respective device using showbox app.

Basically, my issue is that my audio works when I walk the way I use if it’s a statement (Input.GetKey …), but then when. the player! Grounded (basically jump), I stop the sound. When a player reaches the ground again and is already moving in the air, the sound still stops. I can get logic in that because vpn deals I study with GetKey and not with GetKeyDown, but when I do GetKeyDown it keeps me playing practically so that I don’t play the so-called frame. coin master

I would advise you all to try some Music Tips at Smarttip. It helped me and I hope this would help you as well.

To get the latest MOD APK yoou can visit geekfell

also, this is in your update work? would we be able to see your full update()?

When a player reaches the ground again and is already moving in the air

I’d recommend making a new thread as its off topic to this one.

You need to call this capacity from the Update work, since the state gets reset each casing. It won’t return valid until the client has delivered the key

Locking this thread, it’s just a necro/spam magnet.