Search Unity

How to make footstep audio?

Discussion in 'Editor & General Support' started by BlakeGillman, Apr 15, 2014.

  1. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
    I have no idea where to begin, but how would I make footstep audio that plays depending on what your steping on? ( From terrain to the inside of a building's wooden planks or something ) !

    If this makes things easier, all my terrain colors are nearly a single color, a few odd dots put here and there but mostly the same.
     
  2. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
    Anyone got any ideas? I just want so when the player walks over the terrain, depending on the texture he is on a sound plays (The sound of him walking on that type of texture) Grass, Road, Sand, Stone, etc)
     
  3. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
  4. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
    Srsly, NO ONE knows how to do this ? So many F***ing games have this and I cannot figure it out ;(
     
  5. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I suspect it's because a very simple Google search will give you all the answers you need.
     
  6. gooncorp

    gooncorp

    Joined:
    Dec 30, 2011
    Posts:
    131
    i use a raycast and a collider on characters foot. i check the hit.tag of the raycast for the material and also the hit.normal so i can position the footprint decal/particle along the ground. make sure you make the feet kinematic rigidbodies so you can sense the collision. its hard sometimes to get help on here because a lot of people just use toolkits to set up their games instead of coding it so sometimes you may have a hard time finding answers. i wrote all the code for my game im happy to provide more details on this issue.
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Our plugin Master Audio can do this without you writing any code if there's an actual collision or trigger (or any of another 26 events) occurring every time you want to play a sound. Not if you need to raycast though. In any case, I suggest you check out the plugin as it solves all the problems that occur with Unity audio, in a streamlined and efficient way.

    Link here and it's currently 66% off: https://www.assetstore.unity3d.com/#/content/5607
     
  8. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    102
    There is no many complex,just give you an easy way.
    Record a long enough step sound and make it loop.
    Then read it while start to walk(but not read it again while walking),stop sound while detect any other behaviour.
    That can be for not very high demand game because it plays the same speed.:)
     
  9. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
    Actually I mean I am using Unity's default Terrain, and I want so when you walk over the different pained textures on the terrain then that is when the footstep audio comes, I Know how to do it for floors to buildings and such.
     
  10. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412