Hi! I’m a sound designer working on a game and am trying to learn UE4 to be able to implement my own sounds into the game. One thing that I cannot seem to find any documentation or tutorials on is how to get different footstep sounds on different materials. If anyone could point me in the right direction, that would be veyr welcome! Thanks!
This thread is a little bit old (from the beta-time): [Question] How to add footstep sounds? - Audio - Unreal Engine Forums but probably it is still working
I actually figured out how to do this right after I posted the thread, haha… Oh well, if anyone want it explained to them I’ll be happy to help!
I don’t need it right now, maybe later. But post the solution anyway, that way when someone search the forums, we have the solution
I’m interested in the perfect solution too, of course, but wish to take it one step (ha) further. Not just a single sound effect, but a collection of sounds, softer and louder that randomly play when a foot hits the ground. A player’s speed or animation affects sound volume/type.
Crawling and walking are both slow movements, but different sounding, for example. Running is just walking quickly, but requires a different set of sounds. Using one single footstep sound works, but takes out the “life” from the project.
So basically I’m asking the same question as OP, but how to do it more “organically” with randomness in the sounds.
So the ultimate question: How to Blueprint player speed/animation type + ground material + random loud/soft sound effects?
I don’t know about organic, but you can also add a node in a blueprint if that’s your thing to slightly adjust pitch and volume for each instance of collision/whatever. I’ve done that for my projectiles, pulling from a library of about 5 samples for each projectile, and it makes it easier on the ears for sure!
I am trying to work this out via a Single Line Trace on an AnimBlueprint triggered on EventNotifies when the player’s heel bone touches the ground. I would love a tutorial if you have figured out the secret sauce. I know this post is over a month old, but here’s hoping you guys are still watching. Cheers.
I apologize for not responding with my solution, somehow it all got lost in my own work, haha. But I have actually thought of doing an in-depth tutorial (a text one, not video) sometime. What would be a good place to post this? The wiki?
In the meantime, allow me to give you a screenshot of my anim blueprint:
Basically, I’ve created anim notifies at certain frames in the animations, which whenever that frame is played, triggers the event.
(I realized after playing around for some time that the footsteps started getting triggered as soon as the walk/sprint animation started blending in, so the player could have like 0.1 in speed, and the footsteps still got triggered, so in the beginning of each footstep, I just see if the “speed” value is under a certain point. If it is, don’t play the sounds.)
So, whenever the player takes a footstep it does a single line trace. The start point being the current player character, and the end point being the location, minus 150 in the Z dimension. After that, a serious of values are checked. First, check if it even hit something, and only then play the sound. Also, break the hit result to get the location where the trace hit, and play the sound from there (should only matter if the sound itself has attenuation settings). Also, get the surface type. Here comes one of my favorite nodes as of now, the “Select” node.
(Note that you cannot drag a pin out of the “Get surface type” node and create a Select node, you need to create it by just right-clicking anywhere.)
Then drag the surface types into the index pin, and the sound into the return value, and you can effectively choose exactly which sound should be played on which surface type!
I think you already gotten this far, but I feel I should mention this also: To be able to get a surface type form a material, it needs to reference a physical material, which in turn references a surface type. So first, go into Edit>Project Settings. Then under the Physics tab, you can write in your surface types! Metal, wood, etc. Then “Set as default” to save your settings.
Second, create a physical material, practically anywhere you want in your content folder by rightclicking>Physics>Physical Material. You then need to reference that physical material to your surface type by going into your details panel in that Physical material, and under “Physical properties” choose the right surface type.
Third, you need to assign that physical material to the material you want to trigger that surface type. So just go into your material, and literally right below the ball-thingie that showcases the material,m you can choose your physical material!
Sorry for the lengthy explanation, I just hate myself when I find threads that are years old and the guy who got it to work only explains it half-heartedly, haha. But that should cover most, only ask if you need any more help!
Thanks, this is so helpful! Are there any footstep audio collections that you’d recommend for a newbie without any sound libraries? I’ve come footstep audio on Rockshure Soundz, and StockMusic, wondered if either of those were good or if there was others I should consider.
Very cool thank you that work perfectly…
Hi, I am trying to make this work at my end, could you please help by clarifying that how do I create the AnimNotity_PlayFootStep part?
Here’s my blueprint so far:
Actually surprised this thread still lives, haha. Might just do an in-depth tutorial once and for all, I actually feel a bit embarassed creating this thread and then not following it up… Yeah, well, we’ll see.
TheoT: Looking over your blueprint (really fast) it looks just fine! To get the “AnimNotity_PlayFootStep” node, you need to go into your walk/run animation. Right-click on the timeline-thingie (see my picture) and choose “Add Notify…”->“New Notify” and name it basically whatever you like. I named mine PlayFootstep! Be sure to place the notify at the appropriate time in the animation (AKA when the foot is out down, when there should be a footstep sound!). The notify will then show up in your Animation Blueprint if you just search for it! Hope that clears things up for you, tell me if it didn’t and I’ll get back to you. (:
- Favorited page! Thx!
Thanks for the reply! I did just as you suggested but I still have trouble with getting it work. I have the blueprint in the characters’ event graph and the New Noticy set up as you wrote. However, when I walk, the “AnimNotity_PlayFootStep” does not do anything in the blueprint for some reason. It simply isn’t triggered. I tried the same with jump animation but no luck with it either. I can get it to play sound while running by adding Play Sound Add Notify but the problem seems to be in getting the New Notify to trigger in the blueprint.
Could you also please tell me that is the Speed thing on the far left of the blueprint just a regular float variable? I appreciate your blueprint and your help!
I am trying to get the blueprint work with the starter content first person character. The problem is that I can’t get the “FootstepNotify” notify to work in the blueprint. It simply won’t trigger in anyway anyhow. One thing I thought might be wrong is where I place the blueprint? Now I have it placed in the FirstPerson_AnimBlueprint Event Graph as that’s the only place where I can create the AnimNotify…
I had problems getting it to work too. But after taking a better look at the graph, i noticed i had used a vector+vector (z:150) instead of vector-vector operator. That fixed it for me.
Now however, i have two new tasks i need to solve:
- alternate between two sounds (left foot and right foot)
- how do i get something else than “default” into the selector? And also how do i get the materialtypes? I tried to set it under Project settings/Physics/Physical surface, but how do i then assign it to a material and get it into the selector?
Regarding 2) Then i just found out that i should right-click the ‘select’ node and click ‘refresh nodes’ then the Physical surface appeared (only created one so far)
Ok, one more update. I made this graph to handle two different sounds. Not sure it’s the best solution, but gonna post it here anyway.
You can try using Random Node in a sound cue to randomize each sound type I think.
My question is though how to attach this custom Notify to a certain socket like you can with a standard sound or particle Notify. Right now this blueprint has no relation to any sockets whatsoever, it just triggers sounds at player’s feet location, which is really kinda vague.
And also this makes it impossible to add particles to each step as particles have to be attached to a specific bone. The only solution is to add another notify at almost the same time in animation window and to add a particle effect there.
Make sure to use Get Surface Type and NOT to Break Hit Result from the result of the Line Trace. If you Break the structure to get at the Phys Material and then get the surface type from that, it will always return default. (There is of course a way to resolve this but I am unsure exactly how to do so with the blueprinted Line Trace. If it were two objects which are defined, you can have their collisions return the Surface Material).
TLDR: Make sure to use the GetSurfaceType function that takes in a HitResult and returns the user defined enum for Surface Material type.