Adding Footsteps and Randomizing | Audio in Unity Episode3

Поділитися
Вставка
  • Опубліковано 26 січ 2025

КОМЕНТАРІ • 15

  • @stuffedmannequin
    @stuffedmannequin Рік тому +2

    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

    • @nightcrow578
      @nightcrow578 Рік тому +1

      i agree this youtuber needs to explain more furthur

    • @razzierose
      @razzierose 7 місяців тому

      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. ^-^

    • @swishswooshaudio
      @swishswooshaudio  5 місяців тому

      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.

  • @JahvansiMakesGames
    @JahvansiMakesGames Рік тому +1

    No comment yet is weird as this video is really good!
    Clean and simple but it does exavtly what I was looking for :)

  • @jackieestacado5651
    @jackieestacado5651 5 місяців тому

    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 😅😅

    • @swishswooshaudio
      @swishswooshaudio  5 місяців тому

      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.

  • @deeprochakravorty
    @deeprochakravorty 8 місяців тому

    Why is the audio playing twice sometimes? I'm facing this issue.

    • @swishswooshaudio
      @swishswooshaudio  5 місяців тому

      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.

  • @KaganParlatan
    @KaganParlatan 10 місяців тому +1

    Türk olduğunu aksandan hemen anladım.

  • @nightcrow578
    @nightcrow578 Рік тому +1

    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

    • @okkjamie
      @okkjamie 10 місяців тому +2

      maybe look at his other videos, its a series and this is episode 3 so its probabaly explained in either 1 or 2