Greetings everyone. Recently I came up with a desire to do some basic scripting via blueprints and decided to make a floor which will play a specific sound if being stepped on (and each time you move around its surface). I tried to implement that via Hit Events, but a small problem emerged: as I understand, when you are just walking on an object it doesn’t meet the required condition of “hitting” an object, thus in the case with my blueprint a sound is played only when I jump on it.
If I am to ask directly: Is there a way to register the actions of moving around a specific surface each time a player does it?
Thanks everyone in advance.
P.s I use the default player controls similar to those from the official tutorials.
If I got it right you want different step sounds on different types of surfaces.
For this we’re using “Physical Materials” to determine the type of the surface. They can be applied to Landscape Material Layers too.
Then by using Animation Notifies to line trace down to the surface to detect that Physical material.
Normally I do the line trace in the animation blueprint of the character that plays the animation that we created our animation notifies in. But if I’m not mistaken you can do this in your character blueprint too.
Line traces returns the pyhsics material as a hit result.
Here’s a tutorial link for you to follow step by step.
Footstep Sounds on Different Surfaces - Unreal Engine 4 Tutorial - By DevAddict
Thank you very much for your help: I was able to pull off the method from the video. Good luck.
Just get Current Floor from character movement:
To make footsteps, play a footstep sound every time the character moves a certain distance from the last footstep.