How to Play Footsteps Depending on the Surface in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial today I am going to show you on how to play Dynamic footsteps depending on the surface that you're on it's gonna be a very easy way to follow so let's get started but first check out the link in the description to learn how to make an FPS shooter in a real engine type with all the mechanics you need in only one week and if you use the coupon code games in all caps you get 20 off so check it out through the link in the description all right so the first thing we need is of course the footstep sounds itself in my case I have three one for grass one for metal and one for wood so you will need to go ahead and use grab those okay so now what we need to do is create the different surfaces that will be able to detect so for that let's go up into edit project settings search here surface and now we can see all of the physical surface that we can add in this case gonna go to the first one and let's just add grass then in the next one as we're gonna be metal and then last one it will be wood so you'd add all the ones that you want okay so now we need to do is create the physic material itself if we select any mesh we can go and see the physic material all right and that's what we're going to go ahead and just plug it in so let's go to the content browser right click go into physics and choose a physic called material and select the base class and this will be p m or physic material underscore in this case I can name this grass and I'm going to duplicate this I don't have sand and then I will name this wood so now I need to enter in each of them and the only thing I have to do is assign the surface type so for grass this will be grass which is what we have just assigned then for metal this will be metal sorry metal we don't have to change anything else okay unless you want to change the fraction or whatever and for what this will be wood so now with that said we have everything set up so let's go ahead select our matches in the level that we want to apply a thing and assign the specific physics material now I'll leave that for later so let's go ahead and use carry on with the logic itself so we need to do is make a blueprint that will basically shoot a line from our feet into the ground so we can detect in which surface we are standing on so for that what we're going to do is create and a name notify another file is a blueprint that I will be able to call in a specific point in the animation in this case where the feeds are touching the ground so this is right click go into blueprint class all classes and name notify and open this and then notify not the state okay will be used in one that says and I'm notified and apparent so BP underscore for step and then notify let's go ahead and open this up and now what I want to do is go into the functions upright and on the received notify so when this notify is code what I want to do is some stuff in this case for example let's go and just play a sound at location which will be the one of the footsteps for example I don't know what so this is temporary okay of course gonna decide which footstep we want to place but is an example so now I can show you that if we go into the character mannequins animations Queen in my case I'm using round and let this load and then once it loads I enter into the you know run animation which is here you can now go into each specific notify add a new track which will be you know footsteps and now when the feet touches the ground which you know with our real animations is already marked over here but if not you have to you know get the point where the feet touches the ground which is around here right click add and notify in this case we can search our beefy uh footstep and name not a file with that you can just copy go to the next Point press here paste for the next Point click it's important it's important you click or you want and then you just put it there and there we go so each time the foot reaches the ground okay with that said if I press play now you will hear the first steps going on as I walk so now let's make it that of course it will detect which one it has to play so let's go and we can close the animation go back to any modify and before all of this all you have to do is align phrase by Channel a line Trace will be an invisible line that will go from one point to another in this case from our character down into the floor so we just want to get the mesh component and get the owner so the owner of the mesh now we can simply get the actor location so this will be the starting point and then what I want to do is get the up Vector of the character and you sometimes this by a value in this case I want to right click convert this into a float and this will be around minus 200. so it will shoot array downwards okay so from our starting point downwards the only thing left is to go ahead and add a these two vectors and that will be our endpoint okay so this is negative because of course it wants down Vector but there's not such thing as down Vector so we have to you know multiply by that with the number and now and then a value of how you want to go down so now if we you set this for duration we should see that each time we walk we cannot see anything oh yeah we see it but it's very um it's hard to see basically so if we go into here we can change this to just be persistent and you can see it is happening but it doesn't render when my camera is a bit far away for some reason is the first line that actually happens to it but you can see that they're rendering okay well my footsteps are coming a bit strange and that bar I don't want to disappear but anyway so go ahead and spot this back to non because we don't want to debug it and then let's continue if we have actually hit something so we have have hit something we want to get the surface type so with that we can do a switch on enumerator so depending on our surface we can do you can see that they will show up the ones that we have so in this case for wood we will have this one which is of course for wood let's copy and paste this for metal we'll have well the metal footstep so I'll search for model First Step copy and paste and then last but not only is for grass it will be grass so now I can just plug this into the output and then if this Falls I'll directly just go into the output okay I don't need to play a footstep because we are not on the ground or whatever reason so now you will see that by default nothing will play because of course we are in a mesh that doesn't have any physics material so if I were to put this to be with the grass now if I press play you can see the grass playing now maybe it is not too loud so I could just bump up a bit the footsteps so maybe I can put the grass to be at two and the metal to be at 1.3 and the wood to be at 1.2 so you will just hear them a bit better in the recording but now if I press play you can set the grassroot steps plate so if I now were to use get for example this object change the material of the object so it's a bit clearer and for this to be on wood okay for example yeah there's wood over here then I go and put the other physics material which is the wood now and you go through here the wood material starts to play and then I go out so this is exactly what you want and we can do the same just duplicate it and put it to be with the metal so the PM metal which is the one that we created now the other one which is a custom one from unreal and then we can use search for metal and we can put you know whatever metal we want for example use this steel press play again so that's it for this tutorial if you found it helpful I will release it if you like the video and subscribe to my channel got lots of unreal ancient factors so check them out the profiles will be available in my kitchen or YouTube members so check them out join my description follow me to my socials and now yes before I said bye bye [Music] thank you
Info
Channel: Gorka Games
Views: 31,559
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5 play footstep depending on the suface, tutorial, quixel, megascans, unreal engine footsteps surface tutorial ue5, ue5 dynamic footsteps tutorial, ue5 footsteps on surface dynamic tutorial, how to play some footsteps depending on the surface unreal, unreal engine 5 how to make surface footsteps, play footsteps on surface ue5
Id: k28vy4lOpW8
Channel Id: undefined
Length: 9min 21sec (561 seconds)
Published: Wed Sep 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.