I have no idea how to do this and all the tutorials I watched don’t give a hint. This is the only way I can do thin and have my maps custom instead of janky and weird.
Thanks.
Hello! I’ll try to help!
I have to assume certain things first:
- You know how to make a layered landscape material
- You know how to place skeleton notifies in your animation sequences
Start by declaring your surface types in Project Settings. You can just search for “surface”, and it’ll take you there. Type in the names for each surface type in use, and then close Project Settings.
Next, create Physical Materials for each surface type (such as PM_Rock, PM_Grass, PM_Snow, etc). Open each one, and specify the surface type associated with each one. Save them after setting these.
When you go to paint your landscape, you will need to create LayerInfos for each layer. Go through the process of adding them, and take note of where they are being saved. Before you start painting, open each LayerInfo, and specify the Physical Material associated with each one. Again, save them after setting these.
Assuming you’re using LB Weight Blended layers, paint your landscape.
Next, go to the character’s Anim BP, and open the Event Graph. Right click and find your footfall notify event. Follow that with a cast to the character, and use Try Get Pawn Owner for the Object pin. Follow the cast with a line trace by channel. The start of the trace can be obtained by using Get Actor Location from As Third Person Character (or whatever the name of your character BP is). Connect the struct to the “Start” field. Next, pull off the Get Actor Location node, and (depending on the version of Unreal you’re using) search for either “vector minus vector”, or simply “minus” (possibly “subtract”) in UE5 or later. Hook up to the “A” pin only, and hard-code the character’s half-height into the Z field. Be careful to not make the common mistake of using a negative sign, as it is already a subtraction operation.
From the return value of the line trace, search for “Get Surface Type”. Next, get a Switch on EPhysicalMaterial node, and connect the Surface Type return value to the Selection input on the Switch node. From there, you will have separate output execution pins for each surface type, which can be separately connected to “Play Sound At Location” nodes for your different footstep MetaSounds or Sound Cues. If you break the out hit result of the line trace, you can get more specific about the location where you want the sounds to play (such as at the feet, as opposed to the actor’s origin).
You may need to play with the Alpha values of each layer to get things picked up the way you desire.
Good luck, and I hope that helps!