Need help With Sound Cue

I’m working on a FPS movement and i wanted to add footstep sound to my character. I have watched this tutorial. It worked, but I need it the sound cue to play faster when my character sprints. In the tutorial, he said that by setting the “footstep interval” variable to something lower in my sprint code, it will make the sound cue faster. But after doing that, it didn’t work properly. It worked only when i pressed shift (sprinting) first, then W (walking). Can you help me?

Blueprint Screenshots:


Hey @beastvitik! Welcome to the forums!

How are you setting your “Footstep Interval” variable? That is going to be one of the most important factors in all of this.

Any additional specifics you provide will go a long way in solving your problem!

Greetings, thank you for answering!

This is my sprint code where i set the value of “Footstep Interval” variable. I’m also changing the camera FOV there when i sprint.

Screenhots:


Hey @beastvitik,

From what I see and what you’ve said, try adding Event Beginplay → Set Footstep Interval to make sure that everything is initialized correctly.

image

Hopefully the above solves your issue.

Hello! Thank you for helping me so far.

So, it helped a bit, but still have the issue. When I start sprinting, the sound cue still plays the “Footstep Interval” variable set to 0.4 (walking), but after jumping once, it sets the “Footstep Interval” variable to 0.2 (sprinting). After stopping sprinting it still plays the 0.2 (sprinting) one, but again after jumping once, it resets to 0.4 (walking).

Hey @beastvitik!

It may be resetting after your jump and not updating the interval when returning to walking movement mode. Try removing your set footstep interval from your input action, and instead moving it to Event Tick so it check for the bool “Is Sprinting?” instead of checking if the sprint button is pressed.

Hopefully the above solves your problem!

It didn’t help, still the same issue with jumping.

Hey @beastvitik,

So that means that your jump is somehow directly related to your Is Sprinting variable and your sprint action is not actually changing your variable. What is InputAction Sprint set to? Is “Is sprinting?” anywhere else in your blueprint?

Hey, i have checked if my jump code is somehow related to isSprinting variable, but it’s not. i also use “isSprinting” in my CameraShake code. Are there any other methods to implement walking/running footsteps sounds?


Hey @beastvitik

I think I may see your solution. I am assuming you are continuously holding the whatever movement button with this error occuring. In your InputAction Sprint event, right after setting “Is Sprinting” clear your timer and/or call Play Footstep Sound, the same way the jumping reset event works. What I think may be happening is the timer is not being updated correctly.

Hey, can you send me some screenshots of that, got confused a bit, how do i clear the timer?

No problem @beastvitik,

So first you will want to promote your timer output to a variable and reconnect it to your current invalidation:

eLoerIqRls

UnrealEditor_zAfz1kIxZ4

Then you will add clear and invalidate and your Play Footstep sound events like the following, referencing your new timer variable:

More than likely though, you may only need to just call your play footstep sound event like the following:

UnrealEditor_nqsgnVHdY2

I hope the above works for you!

It was not a solution, but I think I found something that could be the key for this problem.
It is the same problem with jumping, but actually it is not related to jumping but something with falling or being on floor. So I placed a platform above the ground and jumped on it. Then i started sprinting on it, no sound, but after falling on the ground (while sprinting), the sound appeared, same thing the other way with just walking.

Hey @beastvitik,

So it looks like we are going to have to look further back into your blueprint to see what could be causing this. A few things:

  • Have you tested your scene with the blueprint open to see what pins fire/light up?
  • After going back over your original blueprint, it seems as though you have the values for your velocity check set pretty high (example you have yours set at 100 while the tutorial is set to 2)

Slightly off topic… Curious.

Why aren’t you using anim notifies on the animations to trigger footstep sounds?

Hello, so sorry for my long response.

I am not using a model and animations for my character, but can I somehow use it?

You just need to use 3rd person animations. Unless you’re doing single player you’ll need a full mesh body and animations anyway.

It is an FPS single player, so can I add a random animation that the player doesn’t see and implement footstep sounds?

You need locomotion animations that fit the movement. So for walking you’d need a walking animation. For jog/run/sprint you would need those as well.

Animation starter pack has them with blend spaces. From there you’d setup aim offsets for the upper half and blend those in the anim graph.

Also have to consider full body shadows…if you want those. At some point you’re going to have a light that’s behind your character. I’d expect to see the shadow of my player.

The proper way to do all of this is by making a Goro character.

For the full body character (3pp) you’d simply set “Owner No See”.

More work but you gain shadows and easy footstep implementation.