Adding Varied Footstep Sounds | Tech Discussion


This wil be a short and simple tech discussion, but I think the solution I came up is quite useful for anyone wanting to add footstep sounds to their 3rd person game in UE4.

The desired features:

  • Footsteps play at the right time in all animations
  • Footstep sounds play randomly so that the player doesn't have to hear the same sound over and over again
  • The volume of the steps can be adjusted per step, based on given animation


Here is how I made it work:

In order to play the sounds at the right time in the animation, I created an Anim Notify called AN_FootstepSound. To get the timing right, so that it played rythmically, for each locomotion animation I found the frame where the first footstep landed and checked the percentage value at that point. 

I then added 50% to that to get the location of the next footstep.

Setting up it up this way rather than trying to line it up with when I thought the character's foot hit the ground in the animation produced a more consistent sounding result. 

Next, in order to play the sound randomly, I simply switched on a random int within AN_FootstepSound, playing 5 different footstep sounds I had. 


Lastly, so that I could vary the volume with each step, I created a variable in AN_FootstepSound and toggled Instance Editable, plugging it into the volume multiplier paremeter of the SpawnSoundAtLocation calls. 


This way I was able to edit the volume of the steps per-instance of AN_Footstep sound.

This proved quite useful for times like when, during the end of an attack animation, the character adjusted their stance lightly. In that instance I was able to quite easily decrease the volume for those smaller steps. 


Here is how it turned out:

Author: Reilly da Silva

Files

Build_5-11-22.zip 885 MB
May 14, 2022

Get Mythicism

Leave a comment

Log in with itch.io to leave a comment.