I have the script and everything completed, but what else do you need to do in order to get these dynamic footsteps? How do you make the game detect what material the player is walking on in order for the correct sound effect to play? I saw something in the script regarding a Raycast
Make sure that the material you apply to the object the player is walking on has the footstep name in it. For example, if you have "grassFS" like the video, you'd probably have put (surfaceMaterial.name.Contains("Grass")) in your script like the video says, so make sure the material you use for the ground has "Grass" in its name. ^-^
As you mentioned, we perform a Raycast to cast a ray. However, to determine which sound should play on which platform, we use structures called "Layers." Essentially, we play a sound based on the layer of the object that the ray hits. In short, all our different platforms have different names for their respective Layers.
I have an issue my simple brain can't figure out, when I jump or transition into a run state/idle state, I might hear a footstep sound being played? I've figured its to do with my characters foot placement at the time the space bar or shift key is pressed or when I let go of the W,A,S,D keys, but I'm not sure how to make it tighter, the animation events are synced up pretty well with the feet, just this little issue is kind of annoying My monkey brain is getting all muddied up trying to figure it out 😅😅
Actually, the issue you're experiencing is quite normal for a system like this. In such systems, we usually trigger an animation event based on the animation playing, and call the sound at that event whenever the animation reaches that stage. Of course, there can be minor issues like this. To make this sound more realistic, I recommend looking into Inverse Kinematics. With IK, not only will your foot movements interact with the environment to achieve a more realistic walk, but the sounds will also be more realistic in this context.
Most likely, you're encountering this issue because your sound is being triggered twice. A simple solution to this would be to use a boolean variable to check if the sound is currently playing. Writing code like "If the sound is not currently active and not playing, then play the sound" should solve the problem.
I have the script and everything completed, but what else do you need to do in order to get these dynamic footsteps? How do you make the game detect what material the player is walking on in order for the correct sound effect to play? I saw something in the script regarding a Raycast
i agree this youtuber needs to explain more furthur
Make sure that the material you apply to the object the player is walking on has the footstep name in it. For example, if you have "grassFS" like the video, you'd probably have put (surfaceMaterial.name.Contains("Grass")) in your script like the video says, so make sure the material you use for the ground has "Grass" in its name. ^-^
As you mentioned, we perform a Raycast to cast a ray. However, to determine which sound should play on which platform, we use structures called "Layers." Essentially, we play a sound based on the layer of the object that the ray hits. In short, all our different platforms have different names for their respective Layers.
No comment yet is weird as this video is really good!
Clean and simple but it does exavtly what I was looking for :)
Thank you!
I have an issue my simple brain can't figure out, when I jump or transition into a run state/idle state, I might hear a footstep sound being played? I've figured its to do with my characters foot placement at the time the space bar or shift key is pressed or when I let go of the W,A,S,D keys, but I'm not sure how to make it tighter, the animation events are synced up pretty well with the feet, just this little issue is kind of annoying
My monkey brain is getting all muddied up trying to figure it out 😅😅
Actually, the issue you're experiencing is quite normal for a system like this. In such systems, we usually trigger an animation event based on the animation playing, and call the sound at that event whenever the animation reaches that stage.
Of course, there can be minor issues like this. To make this sound more realistic, I recommend looking into Inverse Kinematics.
With IK, not only will your foot movements interact with the environment to achieve a more realistic walk, but the sounds will also be more realistic in this context.
Why is the audio playing twice sometimes? I'm facing this issue.
Most likely, you're encountering this issue because your sound is being triggered twice. A simple solution to this would be to use a boolean variable to check if the sound is currently playing. Writing code like "If the sound is not currently active and not playing, then play the sound" should solve the problem.
Türk olduğunu aksandan hemen anladım.
i unsubbed you and unsuggest your channel to my friends, you didnt explain it more on how it works, where it triggers, and how the audio play
maybe look at his other videos, its a series and this is episode 3 so its probabaly explained in either 1 or 2