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?
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).
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.
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?
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.
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.
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)
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.